// necessary to prevent ng-model scope hiding ugliness in egMarcEditBibSource:
$scope.bib_source = {
- id : $scope.bibSource ? $scope.bibSource : null
+ id : $scope.bibSource ? $scope.bibSource : null,
+ name: null
};
$scope.brandNewRecord = false;
$scope.record_type = $scope.recordType || 'bre';
promise = egCore.net.request(
'open-ils.cat', method,
egCore.auth.token(), $scope.recordId,
- $scope.Record().marc(), $scope.Record().source()
+ $scope.Record().marc(), $scope.bib_source.name
);
} else {
'open-ils.cat', method,
egCore.auth.token(),
$scope.Record().marc(),
- $scope.Record().source()
+ $scope.bib_source.name
);
}
function(newVal, oldVal) {
if (newVal !== oldVal) {
$scope.bre.source(newVal);
+ var cbs = $scope.bib_sources.filter(function(s) { return s.id() == newVal });
+ $scope.$parent.bib_source.name = (cbs && cbs[0]) ? cbs[0].source() : null;
}
}
);