From a130bb899d790dc11393276b34d59b2ddd5cc680 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 16 Nov 2010 11:31:41 -0800 Subject: add onload attribute to ng:include --- test/widgetsSpec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/widgetsSpec.js') 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(''); + 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() { -- cgit v1.2.3