From d085142a13cb40a952d6a4aa8ba8a564f0f55ff3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 10 Dec 2013 10:58:17 -0500 Subject: [PATCH] web staff : log templates / dynamic strings Signed-off-by: Bill Erickson --- web-staff-log.txt | 116 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 106 insertions(+), 10 deletions(-) diff --git a/web-staff-log.txt b/web-staff-log.txt index fb29dee544..bc7a169359 100644 --- a/web-staff-log.txt +++ b/web-staff-log.txt @@ -785,8 +785,8 @@ egNet.request(service, method, params).then( For the full technical rundown, see also http://docs.angularjs.org/api/ng.$q[Angular $q Docs]. -2013-12-06 Template Cornucopia ------------------------------- +2013-12-06 Template Cornucopia and Dynamic Strings Experiment +------------------------------------------------------------- Using Angular on top of Template Toolkit gives us lots of options for managing templates. TT lets us INCLUDE (etc.) shared templates on the @@ -823,8 +823,8 @@ Inline Angular Template ~~~~~~~~~~~~~~~~~~~~~~~ Angular templates, regardless of origin, must be represented as -separate, addressable chunk. To give an inline chunk of HTML an -"address", it can be inserted into a +----------------------------------------------------------------------------- + +And here's the confirm dialog code: + +[source,js] +----------------------------------------------------------------------------- +egConfirmDialog.open( + egCheckinStrings.COPY_ALERT_MSG_DIALOG_TITLE, + evt.payload, // copy alert message text + { copy_barcode : args.copy_barcode, + ok : function() { + // on confirm, redo checkout w/ override + performCheckin(args, true) + }, + cancel : function() { + // on cancel, push the event on the list + // to show that it happened + checkinSvc.checkins.items.push(evt); + } + } +); +----------------------------------------------------------------------------- + +You may wonder why I created these as services instead of directives. +http://www.befundoo.com/blog/angularjs-popup-dialog/[These folks], who +developed some similar code, do a pretty good job of explaining why a service +is best in this context. (See "Why create the AngularJS Popup Dialog +Service?"). More on Angular directives later. Future Topics... ---------------- * My (currently) preferred parent scope, child scope, service pattern - * Routing vs Loading * Deep Linking / Managing the _first load_ problem - * When to use Angular Templates vs Template Toolkit Templates * Displaying bib records in the prototype * More testing -- 2.11.0