diff options
| author | Misko Hevery | 2012-01-24 22:42:33 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-01-25 11:50:37 -0800 |
| commit | e2b1d9e994e50bcd01d237302a3357bc7ebb6fa5 (patch) | |
| tree | a49246c84ba1dc0c34525fbe9819d5f649282be5 /src/widgets.js | |
| parent | 9ee2cdff44e7d496774b340de816344126c457b3 (diff) | |
| download | angular.js-e2b1d9e994e50bcd01d237302a3357bc7ebb6fa5.tar.bz2 | |
feat(scriptTemplateLoader): provide template inlining
populates $templateCache with content of ng-template scripts
Diffstat (limited to 'src/widgets.js')
| -rw-r--r-- | src/widgets.js | 12 |
1 files changed, 12 insertions, 0 deletions
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()); + } + } + }; +}]; |
