aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVojta Jina2012-03-30 13:55:33 -0700
committerVojta Jina2012-04-03 10:10:44 -0700
commit428f2b563663315df4f235ca19cef4bdcf82e2ab (patch)
tree0e9d60777ced649d8fcf3357ac8456c029b99ec5 /src
parent199ac269869a57bb63d60c9b3f510d546bf0c9b2 (diff)
downloadangular.js-428f2b563663315df4f235ca19cef4bdcf82e2ab.tar.bz2
feat(ngInclude): allow ngInclude on css class
And make it terminal so that it does not compile its content, which would cause leaks.
Diffstat (limited to 'src')
-rw-r--r--src/ng/directive/ngInclude.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js
index f6159813..6a656cb6 100644
--- a/src/ng/directive/ngInclude.js
+++ b/src/ng/directive/ngInclude.js
@@ -3,7 +3,7 @@
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-include
- * @restrict EA
+ * @restrict ECA
*
* @description
* Fetches, compiles and includes an external HTML fragment.
@@ -74,7 +74,8 @@
var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile',
function($http, $templateCache, $anchorScroll, $compile) {
return {
- restrict: 'EA',
+ restrict: 'ECA',
+ terminal: true,
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || '',
nction($rootScope){ $rootScope.text = 'WORKS!' }); }); $script.ready(['myCode', 'prettify'], function() { angular.bootstrap(document, ['bootstrapPrettify', 'bootstrap']); }); </script> <link rel="stylesheet" href="../../src/bootstrap/google-prettify/prettify.css" type="text/css"> <link rel="stylesheet" href="../../src/bootstrap/css/bootstrap.css" type="text/css"> </head> <body> <div class="container"> <div class="row"> <div class="span12"> <h1>AngularJS is {{'working'}}</h1> <h2>Directive: <code>prettify</code></h2> <pre class="prettyprint linenums"> &lt;p&gt;Sample text here...&lt;/p&gt; </pre> <h2>Directive: <code>ng-set-text</code></h2> <pre class="prettyprint linenums" ng-set-text="hello.html"></pre> <script type="text/html" id="hello.html"> <h1>Hello World!</h1> </script> <h2>Directive: <code>ng-html-wrap</code></h2> <pre class="prettyprint linenums" ng-set-text="hello.html" ng-html-wrap="angular.js angular-resource.js myApp abc.js abc.css"></pre> <h2>Directive <code>ng-embed-app</code></h2> <div ng-embed-app="myApp">{{text}}</div> <h1>Bootstrap</h1> <h2>Directive <code>drop-down-toggle</code></h2> <div class="btn btn-primary dropdown"> <a href="#ABC" class="dropdown-toggle"> Account <b class="caret"></b> </a> <ul class="dropdown-menu"> <li>One</li> <li>Two</li> </ul> </div> <h2 ng-init="state = 'tab-2' ">Directive <code>tabbable</code></h2> state = {{state}} <div class="tabbable" ng-model="state"> <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> Tab content {{id}}! </div> </div> <hr/> <div class="tabbable" ng-model="state"> <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> Tab content {{id}}! </div> </div> <hr/> <div class="tabbable"> <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> Tab content {{id}}! </div> </div> </div> </div> </div> <br/> <br/> <br/> <br/> <br/> <br/> </body> </html>