diff options
| author | Misko Hevery | 2011-11-22 21:28:39 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-01-25 11:50:37 -0800 |
| commit | 9ee2cdff44e7d496774b340de816344126c457b3 (patch) | |
| tree | 476ffcb4425e7160865029d6b57d41b766750285 /test/ScenarioSpec.js | |
| parent | 8af4fde18246ac1587b471a549e70d5d858bf0ee (diff) | |
| download | angular.js-9ee2cdff44e7d496774b340de816344126c457b3.tar.bz2 | |
refactor(directives): connect new compiler
- turn everything into a directive
Diffstat (limited to 'test/ScenarioSpec.js')
| -rw-r--r-- | test/ScenarioSpec.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index 986e2121..2070d301 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -1,23 +1,30 @@ 'use strict'; describe("ScenarioSpec: Compilation", function() { + var element; + + afterEach(function() { + dealoc(element); + }); + + describe('compilation', function() { 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]; - $compile(node)($rootScope); + element = $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, $compile) { - var element = $compile(jqLite('<div>{{a=123}}</div>'))($rootScope); + 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, $compile) { - var element = $compile('<div>{{a=123}}</div>')($rootScope); + element = $compile('<div>{{a=123}}</div>')($rootScope); $rootScope.$digest(); expect(jqLite(element).text()).toEqual('123'); })); |
