In the work to separate the item service into a reusable component, a
reference to $scope was left hanging around. This causes the service to die
before it can complete its work. The code using $scope does seem to be
necessary, so we'll have the function accept an outer_scope parameter and
adjust the call sites.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
}
function mark_missing_pieces(copy) {
- itemSvc.mark_missing_pieces(copy);
+ itemSvc.mark_missing_pieces(copy,$scope);
}
$scope.print_letter = function() {
$scope.selectMe = false;
$scope.letter = null;
- get_copy(args.barcode).then(mark_missing_pieces);
+ get_copy(args.barcode).then(function(c){ return mark_missing_pieces(c,$scope) });
}
}])
angular.forEach(items, function(i){
i.acp.call_number(i.acn);
i.acp.call_number().record(i.record);
- itemSvc.mark_missing_pieces(i.acp);
+ itemSvc.mark_missing_pieces(i.acp,$scope);
});
}
}
}
- service.mark_missing_pieces = function(copy) {
+ service.mark_missing_pieces = function(copy,outer_scope) {
var b = copy.barcode();
var t = egCore.idl.toHash(copy.call_number()).record.title;
egConfirmDialog.open(
}
if (payload.letter) {
- $scope.letter = payload.letter.template_output().data();
+ outer_scope.letter = payload.letter.template_output().data();
}
// apply patron penalty