aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/compileSpec.js
diff options
context:
space:
mode:
authorIgor Minar2013-10-03 16:24:24 -0700
committerIgor Minar2013-10-03 22:19:46 -0700
commitfe2145016cb057c92f9f01b32c58b4d7259eb6ee (patch)
tree3842d3b8da43352d5d0c10e52f7ae70ec4720645 /test/ng/compileSpec.js
parenta27b4cf5fd81a6cb6b990017dbe77d3090b0e22d (diff)
downloadangular.js-fe2145016cb057c92f9f01b32c58b4d7259eb6ee.tar.bz2
fix($compile): don't terminate compilation for regular transclusion directives
Previously we would stop the compilation for both regular and element transclusion directives which was wrong. Only element transclusion directives should be terminal.
Diffstat (limited to 'test/ng/compileSpec.js')
-rwxr-xr-xtest/ng/compileSpec.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index 1e66b49f..f164ca7a 100755
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -2905,6 +2905,30 @@ describe('$compile', function() {
expect(log).toEqual('pre(); post(unicorn!)');
});
});
+
+
+ it('should terminate compilation only for element trasclusion', function() {
+ module(function() {
+ directive('elementTrans', function(log) {
+ return {
+ transclude: 'element',
+ priority: 50,
+ compile: log.fn('compile:elementTrans')
+ };
+ });
+ directive('regularTrans', function(log) {
+ return {
+ transclude: true,
+ priority: 50,
+ compile: log.fn('compile:regularTrans')
+ };
+ });
+ });
+ inject(function(log, $compile, $rootScope) {
+ $compile('<div><div element-trans log="elem"></div><div regular-trans log="regular"></div></div>')($rootScope);
+ expect(log).toEqual('compile:elementTrans; compile:regularTrans; regular');
+ });
+ });
});
@@ -3256,7 +3280,7 @@ describe('$compile', function() {
$rootScope.dataOnVar = 'data-on text';
$rootScope.$apply();
expect(element.attr('data-on')).toEqual('data-on text');
-
+
element = $compile('<button on="{{onVar}}"></script>')($rootScope);
$rootScope.onVar = 'on text';
$rootScope.$apply();