egSerialsCoreSvc.fetch($scope.bibId);
- // convert to sitem funcs
- $scope.createScap = function(pred) {
- var scap = egCore.idl.fromTypedHash(pred);
- egCore.pcrud.create(scap).then(function() {
- // completely reset the model in order to reset the
- // forms; causes a blink, alas
- $scope.predictions = [];
- $scope.new_prediction = null;
- egSerialsCoreSvc.fetch($scope.bibId).then(function() {
- reload($scope.ssubId);
- });
- });
- }
- $scope.updateScap = function(pred) {
- var scap = egCore.idl.fromTypedHash(pred);
- egCore.pcrud.update(scap).then(function() {
- // completely reset the model in order to reset the
- // forms; causes a blink, alas
- $scope.predictions = [];
- egSerialsCoreSvc.fetch($scope.bibId).then(function() {
- reload($scope.ssubId);
- });
- });
- }
- $scope.deleteScap = function(pred) {
- var scap = egCore.idl.fromTypedHash(pred);
- // TODO ask to confirm
- // TODO check whether there are linked issuances
- egCore.pcrud.remove(scap).then(function() {
- // completely reset the model in order to reset the
- // forms; causes a blink, alas
- $scope.predictions = [];
- egSerialsCoreSvc.fetch($scope.bibId).then(function() {
- reload($scope.ssubId);
- });
- });
- }
-
-
}]
}
})