aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatias Niemelä2013-08-02 17:51:43 -0400
committerMisko Hevery2013-08-09 14:39:57 -0700
commit1b5bee4fa12b1f14e117f7ca222c2e2b64cc8558 (patch)
tree57654eb39ebd714b4d8d4b6570f0227bfaa5660b /test
parent45dc9ee7b4a1e004f9fb7edde41d4805d1402ffa (diff)
downloadangular.js-1b5bee4fa12b1f14e117f7ca222c2e2b64cc8558.tar.bz2
fix(ngInclude): ensure ngInclude is terminal and uses its own manual transclusion system
Diffstat (limited to 'test')
-rw-r--r--test/ng/directive/ngIncludeSpec.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ng/directive/ngIncludeSpec.js b/test/ng/directive/ngIncludeSpec.js
index f1bfbba2..b712c130 100644
--- a/test/ng/directive/ngIncludeSpec.js
+++ b/test/ng/directive/ngIncludeSpec.js
@@ -280,6 +280,31 @@ describe('ngInclude', function() {
dealoc(element);
}));
+ it('should compile only the inner content once', function() {
+ var log = [];
+
+ module(function($compileProvider) {
+ $compileProvider.directive('compileLog', function() {
+ return {
+ compile: function() {
+ log.push('compile');
+ }
+ };
+ });
+ });
+
+ inject(function($compile, $rootScope, $templateCache) {
+ $templateCache.put('tpl.html', [200, '<div compile-log>123</div>', {}]);
+ element = $compile('<div><div ng-include="exp"></div></div>')($rootScope);
+
+ $rootScope.exp = 'tpl.html';
+ $rootScope.$digest();
+
+ expect(element.text()).toBe('123');
+ expect(log).toEqual(['compile']);
+ });
+ });
+
describe('autoscoll', function() {
var autoScrollSpy;