From b37e8a2b141761d3211b52b8b6802c49c92d44f8 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 28 Feb 2012 12:00:32 -0800 Subject: docs(directive.script): Add simple example of inlined template --- src/widgets.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/widgets.js b/src/widgets.js index d515d94d..adc373e0 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -781,6 +781,32 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp }]; +/** + * @ngdoc widget + * @name angular.module.ng.$compileProvider.directive.script + * + * @description + * Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the + * template can be used by `ng:include` or `ng:view`. + * + * @example + + + + + Load inlined template +
+
+ + it('should load template defined inside script tag', function() { + element('#tpl-link').click(); + expect(element('#tpl-content').text()).toMatch(/Content of the template/); + }); + +
+ */ var scriptTemplateLoader = ['$templateCache', function($templateCache) { return { terminal: true, -- cgit v1.2.3