diff options
| author | Igor Minar | 2010-11-16 11:31:41 -0800 | 
|---|---|---|
| committer | Igor Minar | 2010-11-16 11:35:43 -0800 | 
| commit | a130bb899d790dc11393276b34d59b2ddd5cc680 (patch) | |
| tree | 76c7bc4135933b0a6a1cbc1444d52857b139ebb8 /test/widgetsSpec.js | |
| parent | cc749760fd59418433de5a055d1ca401f7500444 (diff) | |
| download | angular.js-a130bb899d790dc11393276b34d59b2ddd5cc680.tar.bz2 | |
add onload attribute to ng:include
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 34ea6b1d..03eb3acd 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -532,6 +532,19 @@ describe("widget", function(){        // we need to have real events on the scopes.        expect(element.text()).toEqual('4');      }); + +    it('should evaluate onload expression when a partial is loaded', function() { +      var element = jqLite('<ng:include src="url" onload="loaded = true"></ng:include>'); +      var scope = angular.compile(element); + +      expect(scope.loaded).not.toBeDefined(); + +      scope.url = 'myUrl'; +      scope.$inject('$xhr.cache').data.myUrl = {value:'my partial'}; +      scope.$init(); +      expect(element.text()).toEqual('my partial'); +      expect(scope.loaded).toBe(true); +    });    });    describe('a', function() {  | 
