Skip to content

Commit

Permalink
Merge pull request #35 from TAMULib/1.1.x-abstract-repo-model-update
Browse files Browse the repository at this point in the history
Added a remove and empty method to the repo
  • Loading branch information
wwelling authored Nov 16, 2016
2 parents 8c0fa58 + cf7e91b commit 1224693
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 1224693

Please sign in to comment.