/**
- * Simple directive for rending the HTML view of a bib record.
+ * Simple directive for rending the HTML view of a MARC record.
*
* <eg-record-html record-id="myRecordIdScopeVariable"></eg-record-id>
+ * OR
+ * <eg-record-html marc-xml="myMarcXmlVariable"></eg-record-html>
*
* The value of myRecordIdScopeVariable is watched internally and the
* record is updated to match.
.directive('egRecordHtml', function() {
return {
restrict : 'AE',
- scope : {recordId : '='},
+ scope : {
+ recordId : '=',
+ marcXml : '@',
+ },
link : function(scope, element, attrs) {
scope.element = angular.element(element);
egCore.net.request(
'open-ils.search',
'open-ils.search.biblio.record.html',
- $scope.recordId
+ $scope.recordId,
+ false,
+ $scope.marcXml
).then(function(html) {
if (!html) return;
}
);
- if ($scope.recordId)
+ if ($scope.recordId || $scope.marcXml)
loadRecordHtml();
}
]