From 3c2d2d2778f2939c0d0e0ecf553d1908f9005d61 Mon Sep 17 00:00:00 2001 From: lisandropuzzolo Date: Tue, 8 Oct 2013 09:29:43 -0300 Subject: [PATCH] added 'loaded' to the template binding, so you can get notified when the template is loaded --- src/ExternalTemplateSource.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ExternalTemplateSource.js b/src/ExternalTemplateSource.js index 3263d17..a40f282 100644 --- a/src/ExternalTemplateSource.js +++ b/src/ExternalTemplateSource.js @@ -45,6 +45,12 @@ ko.utils.extend(ExternalTemplateSource.prototype, { self.data("precompiled",null); self.template(tmpl); self.loaded = true; + if( ko.isWriteableObservable( self.options.loaded ) ) { + setTimeout(function(){ + self.options.loaded(true); + }, 0); + } + }); } -}); \ No newline at end of file +});