diff options
| author | Igor Minar | 2011-01-19 21:47:14 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-19 21:47:14 -0800 |
| commit | 17ee0f031ac4a37bf9a1dc8c87ffac4bd164d1cc (patch) | |
| tree | db799a01074f9b389fc4c069189150381d075df6 /test/widgetsSpec.js | |
| parent | 10646c9f6f62dd5130606d07ffe69770b3973f47 (diff) | |
| download | angular.js-17ee0f031ac4a37bf9a1dc8c87ffac4bd164d1cc.tar.bz2 | |
fix ng:include issue introduced by a5eb3ed1
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 27c5cb82..6ec056ca 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -609,7 +609,24 @@ describe("widget", function(){ }); describe('ng:include', function(){ - it('should include on external file', function() { + it('should include on external file and create a new child scope', function() { + var element = jqLite('<ng:include src="url"></ng:include>'); + var scope = angular.compile(element); + scope.counter = 0; + scope.url = 'myUrl'; + scope.$service('$xhr.cache').data.myUrl = {value:'{{counter = counter + 1}}'}; + scope.$init(); + scope.$service('$browser').defer.flush(); + expect(element.text()).toEqual('2'); + + //should also propagate evals to the child scope + scope.$eval(); + expect(element.text()).toEqual('3'); + + dealoc(scope); + }); + + it('should include on external file and use an existing child scope', function() { var element = jqLite('<ng:include src="url" scope="childScope"></ng:include>'); var scope = angular.compile(element); scope.childScope = createScope(); |
