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:
Stephen Bunch
2014-08-19 08:00:17 -07:00
committed by Peter Bacon Darwin
parent cfdd16157e
commit fd2d6c02f9
2 changed files with 15 additions and 6 deletions

View File

@@ -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);
}));