From 55ddb8bcfa5fd1041a59767963f47ede6356daf2 Mon Sep 17 00:00:00 2001 From: lisandropuzzolo Date: Tue, 8 Oct 2013 08:51:20 -0300 Subject: [PATCH] Update ExternalTemplateSource.js Added the option to pass a writeable observable to the template binding, in order to get notified when the template was loaded. example:
Template was loaded
--- src/ExternalTemplateSource.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ExternalTemplateSource.js b/src/ExternalTemplateSource.js index 3263d17..3116a4c 100644 --- a/src/ExternalTemplateSource.js +++ b/src/ExternalTemplateSource.js @@ -45,6 +45,14 @@ ko.utils.extend(ExternalTemplateSource.prototype, { self.data("precompiled",null); self.template(tmpl); self.loaded = true; + + if( ko.isWriteableObservable( self.options.loaded ) ) self.options.loaded(true); // this alows to pass a writeable observable to the template binding in order to get notified when the template was loaded + // example: + // + //
+ //
Template was loaded
+ + }); } -}); \ No newline at end of file +});