From fff31d8d612430caf10a61a85e81e8c6c3629138 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 3 May 2012 00:15:07 -0700 Subject: style($compile): clean up the code and normalize fn names --- test/ng/compileSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ng') diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 1c4a1d30..b2a6856b 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -1088,6 +1088,21 @@ describe('$compile', function() { })); + it('should allow creation of new scopes for replace directives with templates in a repeater', + inject(function($rootScope, $compile, log, $httpBackend) { + $httpBackend.expect('GET', 'trscope.html'). + respond('

{{name}}; scopeId: {{$id}} |

'); + element = $compile('
')($rootScope); + $httpBackend.flush(); + expect(log).toEqual('LOG; log-003-002; 003; LOG; log-005-004; 005; LOG; log-007-006; 007'); + $rootScope.name = 'Jozo'; + $rootScope.$apply(); + expect(element.text()).toBe('Jozo; scopeId: 003 |Jozo; scopeId: 005 |Jozo; scopeId: 007 |'); + expect(element.find('p').scope().$id).toBe('003'); + expect(element.find('a').scope().$id).toBe('003'); + })); + + it('should allow creation of new isolated scopes for directives with templates', inject( function($rootScope, $compile, log, $httpBackend) { $httpBackend.expect('GET', 'tiscope.html').respond(''); -- cgit v1.2.3