From 6e86943b5ae02217330ec71ef30ecf68abe0f9ff Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 25 Aug 2017 11:50:27 -0400 Subject: [PATCH] LP#1251394 egBibDisplay service examples Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../ui/default/staff/cat/services/record.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/record.js b/Open-ILS/web/js/ui/default/staff/cat/services/record.js index 8dbbef2d4d..7aa25e13c2 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/record.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/record.js @@ -232,6 +232,47 @@ angular.module('egCoreMod') * the prescribed fields from the IDL (and database view), while the * 'mfde' hash-based objects contain all configured display fields, * including local/custom fields. + * + * Example: + * + * -- + * // Display well-known fields + * + * $scope.record = copy.call_number().record(); + * + * // translate wide display entry values inline + * egBibDisplay.mwdeJSONToJS($scope.record.wide_display_entry()); + * + *
Title:
+ *
{{record.wide_display_entry().title()}}
+ * + * --- + * // Display any field using known keys + * + * $scope.all_display_fields = + * egBibDisplay.mfdeToHash(record.flat_display_entries()); + * + *
Title:
+ *
{{all_display_fields.title}}
+ * + * --- + * // Display all fields dynamically, using confgured labels + * + * $scope.all_display_fields_with_meta = + * egBibDisplay.mfdeToMetaHash(record.flat_display_entries()); + * + *
+ *
Field Label
{{content.label}}
+ *
+ *
+ *
Field Value
{{val}}
+ *
+ *
+ *
+ *
Field Value
{{content.value}}
+ *
+ *
+ * */ .factory('egBibDisplay', ['$q', 'egCore', function($q, egCore) { var service = {}; -- 2.43.2