Skip to content

Commit

Permalink
Added a remove and empty method to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremythuff committed Nov 16, 2016
1 parent 48c2bbf commit cf7e91b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/repo/abstractRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ core.service("AbstractRepo", function ($rootScope, $q, WsApi, ValidationStore) {
build(modelJsons);
};

abstractRepo.remove = function(modelToRemove) {
for(var i in list) {
if(list[i].id===modelToRemove.id) {
list.splice(i,1);
break;
}
}
};

abstractRepo.empty = function() {
list.length=0;
};

abstractRepo.getEntityName = function() {
return entityName;
};
Expand Down

0 comments on commit cf7e91b

Please sign in to comment.