aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/compileSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/compileSpec.js')
-rwxr-xr-xtest/ng/compileSpec.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index c017bfa6..f2fa4ef6 100755
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -969,6 +969,32 @@ describe('$compile', function() {
});
});
+ it('should resolve widgets after cloning in append mode without $templateCache', function() {
+ module(function($exceptionHandlerProvider) {
+ $exceptionHandlerProvider.mode('log');
+ });
+ inject(function($compile, $templateCache, $rootScope, $httpBackend, $browser,
+ $exceptionHandler) {
+ $httpBackend.expect('GET', 'cau.html').respond('<span>{{name}}</span>');
+ $rootScope.name = 'Elvis';
+ var template = $compile('<div class="cau"></div>');
+ var e1;
+ var e2;
+
+ e1 = template($rootScope.$new(), noop); // clone
+ expect(e1.text()).toEqual('');
+
+ $httpBackend.flush();
+
+ e2 = template($rootScope.$new(), noop); // clone
+ $rootScope.$digest();
+ expect(e1.text()).toEqual('Elvis');
+ expect(e2.text()).toEqual('Elvis');
+
+ dealoc(e1);
+ dealoc(e2);
+ });
+ });
it('should resolve widgets after cloning in inline mode', function() {
module(function($exceptionHandlerProvider) {
@@ -1010,6 +1036,33 @@ describe('$compile', function() {
});
});
+ it('should resolve widgets after cloning in inline mode without $templateCache', function() {
+ module(function($exceptionHandlerProvider) {
+ $exceptionHandlerProvider.mode('log');
+ });
+ inject(function($compile, $templateCache, $rootScope, $httpBackend, $browser,
+ $exceptionHandler) {
+ $httpBackend.expect('GET', 'cau.html').respond('<span>{{name}}</span>');
+ $rootScope.name = 'Elvis';
+ var template = $compile('<div class="i-cau"></div>');
+ var e1;
+ var e2;
+
+ e1 = template($rootScope.$new(), noop); // clone
+ expect(e1.text()).toEqual('');
+
+ $httpBackend.flush();
+
+ e2 = template($rootScope.$new(), noop); // clone
+ $rootScope.$digest();
+ expect(e1.text()).toEqual('Elvis');
+ expect(e2.text()).toEqual('Elvis');
+
+ dealoc(e1);
+ dealoc(e2);
+ });
+ });
+
it('should be implicitly terminal and not compile placeholder content in append', inject(
function($compile, $templateCache, $rootScope, log) {