diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/AngularPublic.js | 1 | ||||
| -rw-r--r-- | src/widgets.js | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/AngularPublic.js b/src/AngularPublic.js index 516bbad4..d052c35b 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -69,6 +69,7 @@ function publishExternalAPI(angular){ input: inputDirective, textarea: inputDirective, form: ngFormDirective, + script: scriptTemplateLoader, select: selectDirective, option: optionDirective, ngBind: ngBindDirective, diff --git a/src/widgets.js b/src/widgets.js index cf32bdc1..68c40b92 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -813,3 +813,15 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp }); }; }]; + + +var scriptTemplateLoader = ['$templateCache', function($templateCache) { + return { + compile: function(element, attr) { + if (attr.type == 'text/ng-template') { + var templateUrl = attr.id; + $templateCache.put(templateUrl, element.text()); + } + } + }; +}]; |
