From d12df0d360fe0dabdca3591654327834bee2803b Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 25 Oct 2011 22:21:21 -0700 Subject: refactor(compiler) turn compiler into a service BREAK - remove angular.compile() since the compile method is now a service and needs to be injected --- test/AngularSpec.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/AngularSpec.js') diff --git a/test/AngularSpec.js b/test/AngularSpec.js index eb64a825..7e6f35fa 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -423,7 +423,7 @@ describe('angular', function() { describe('directive', function() { - it('should register directives with case-insensitive id', function() { + it('should register directives with case-insensitive id', inject(function($compile) { angularDirective('ALLCAPS', function(val, el) {el.text('+' + val + '+')}); angularDirective('lowercase', function(val, el) {el.text('-' + val + '-')}); @@ -433,14 +433,14 @@ describe('angular', function() { '' + 'xx4' + ''); - compile(el); + $compile(el); expect(lowercase(sortedHtml(el))).toBe('
' + '+xx1+' + '+xx2+' + '+xx3+' + '-xx4-' + '
'); - }); + })); }); @@ -458,25 +458,25 @@ describe('angular', function() { }); describe('compile', function() { - it('should link to existing node and create scope', inject(function($rootScope) { + it('should link to existing node and create scope', inject(function($rootScope, $compile) { var template = angular.element('
{{greeting = "hello world"}}
'); - angular.compile(template)($rootScope); + $compile(template)($rootScope); $rootScope.$digest(); expect(template.text()).toEqual('hello world'); expect($rootScope.greeting).toEqual('hello world'); })); - it('should link to existing node and given scope', inject(function($rootScope) { + it('should link to existing node and given scope', inject(function($rootScope, $compile) { var template = angular.element('
{{greeting = "hello world"}}
'); - angular.compile(template)($rootScope); + $compile(template)($rootScope); $rootScope.$digest(); expect(template.text()).toEqual('hello world'); })); - it('should link to new node and given scope', inject(function($rootScope) { + it('should link to new node and given scope', inject(function($rootScope, $compile) { var template = jqLite('
{{greeting = "hello world"}}
'); - var templateFn = angular.compile(template); + var templateFn = $compile(template); var templateClone = template.clone(); var element = templateFn($rootScope, function(clone){ @@ -490,9 +490,9 @@ describe('angular', function() { expect($rootScope.greeting).toEqual('hello world'); })); - it('should link to cloned node and create scope', inject(function($rootScope) { + it('should link to cloned node and create scope', inject(function($rootScope, $compile) { var template = jqLite('
{{greeting = "hello world"}}
'); - var element = angular.compile(template)($rootScope, noop); + var element = $compile(template)($rootScope, noop); $rootScope.$digest(); expect(template.text()).toEqual(''); expect(element.text()).toEqual('hello world'); -- cgit v1.2.3