diff options
| author | Misko Hevery | 2011-10-25 22:21:21 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2011-11-14 16:39:32 -0800 | 
| commit | d12df0d360fe0dabdca3591654327834bee2803b (patch) | |
| tree | 605694ecc056869e9dd20283d8256c92655a44d4 /test/ScenarioSpec.js | |
| parent | d9b58f23f6b3fe5635c3ec5259e6a0002cff78b7 (diff) | |
| download | angular.js-d12df0d360fe0dabdca3591654327834bee2803b.tar.bz2 | |
refactor(compiler) turn compiler into a service
BREAK
- remove angular.compile() since the compile method is now a service and needs to be injected
Diffstat (limited to 'test/ScenarioSpec.js')
| -rw-r--r-- | test/ScenarioSpec.js | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index d33e880d..986e2121 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -2,22 +2,22 @@  describe("ScenarioSpec: Compilation", function() {    describe('compilation', function() { -    it("should compile dom node and return scope", inject(function($rootScope) { +    it("should compile dom node and return scope", inject(function($rootScope, $compile) {        var node = jqLite('<div ng:init="a=1">{{b=a+1}}</div>')[0]; -      angular.compile(node)($rootScope); +      $compile(node)($rootScope);        $rootScope.$digest();        expect($rootScope.a).toEqual(1);        expect($rootScope.b).toEqual(2);      })); -    it("should compile jQuery node and return scope", inject(function($rootScope) { -      var element = compile(jqLite('<div>{{a=123}}</div>'))($rootScope); +    it("should compile jQuery node and return scope", inject(function($rootScope, $compile) { +      var element = $compile(jqLite('<div>{{a=123}}</div>'))($rootScope);        $rootScope.$digest();        expect(jqLite(element).text()).toEqual('123');      })); -    it("should compile text node and return scope", inject(function($rootScope) { -      var element = angular.compile('<div>{{a=123}}</div>')($rootScope); +    it("should compile text node and return scope", inject(function($rootScope, $compile) { +      var element = $compile('<div>{{a=123}}</div>')($rootScope);        $rootScope.$digest();        expect(jqLite(element).text()).toEqual('123');      })); | 
