mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 10:05:34 +08:00
add onload attribute to ng:include
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user