mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
feat(ngInclude): add template url parameter to events
The 'src` (i.e. the url of the template to load) is now provided to the `$includeContentRequested`, `$includeContentLoaded` and `$includeContentError` events. Closes #8453 Closes #8454
This commit is contained in:
committed by
Peter Bacon Darwin
parent
cfdd16157e
commit
fd2d6c02f9
@@ -121,7 +121,7 @@ describe('ngInclude', function() {
|
||||
element = $compile('<div><div><ng:include src="\'url\'"></ng:include></div></div>')($rootScope);
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(contentRequestedSpy).toHaveBeenCalledOnce();
|
||||
expect(contentRequestedSpy).toHaveBeenCalledOnceWith(jasmine.any(Object), 'url');
|
||||
|
||||
$httpBackend.flush();
|
||||
}));
|
||||
@@ -139,7 +139,7 @@ describe('ngInclude', function() {
|
||||
element = $compile('<div><div><ng:include src="\'url\'"></ng:include></div></div>')($rootScope);
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(contentLoadedSpy).toHaveBeenCalledOnce();
|
||||
expect(contentLoadedSpy).toHaveBeenCalledOnceWith(jasmine.any(Object), 'url');
|
||||
}));
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ describe('ngInclude', function() {
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(contentLoadedSpy).not.toHaveBeenCalled();
|
||||
expect(contentErrorSpy).toHaveBeenCalledOnce();
|
||||
expect(contentErrorSpy).toHaveBeenCalledOnceWith(jasmine.any(Object), 'tpl.html');
|
||||
expect(element.children('div').contents().length).toBe(0);
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user