Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
edit collection function
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Feb 28, 2017
1 parent 2b632ce commit b5a7b93
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/services/local-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ export class LocalStore{
this.storeCollections(collections);
this.updateCollections(collections);
}
editCollection(oldName:string,newName:string){
var key = oldName.toLowerCase();
var newKey = newName.toLowerCase();
var collections = this._collections.getValue();
collections[newKey] = collections[key];
delete collections[key];
collections.collections.splice(collections.collections.indexOf(oldName),1, newName);
this.storeCollections(collections);
this.updateCollections(collections);
}
addPicToCollection(pic, collection){
collection = collection.toLowerCase();
var collections = this._collections.getValue();
Expand Down

0 comments on commit b5a7b93

Please sign in to comment.