aboutsummaryrefslogtreecommitdiffstats
path: root/src/directive/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/directive/script.js')
-rw-r--r--src/directive/script.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/directive/script.js b/src/directive/script.js
deleted file mode 100644
index 4090ae24..00000000
--- a/src/directive/script.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc directive
- * @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`, `ng-view` or directive templates.
- *
- * @restrict E
- * @param {'text/ng-template'} type must be set to `'text/ng-template'`
- *
- * @example
- <doc:example>
- <doc:source>
- <script type="text/ng-template" id="/tpl.html">
- Content of the template.
- </script>
-
- <a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
- <div id="tpl-content" ng-include src="currentTpl"></div>
- </doc:source>
- <doc:scenario>
- it('should load template defined inside script tag', function() {
- element('#tpl-link').click();
- expect(element('#tpl-content').text()).toMatch(/Content of the template/);
- });
- </doc:scenario>
- </doc:example>
- */
-var scriptDirective = ['$templateCache', function($templateCache) {
- return {
- restrict: 'E',
- terminal: true,
- compile: function(element, attr) {
- if (attr.type == 'text/ng-template') {
- var templateUrl = attr.id;
- $templateCache.put(templateUrl, element.text());
- }
- }
- };
-}];