From 02dc2aa1b139071c36ac95caf684f357021bdca7 Mon Sep 17 00:00:00 2001 From: Stephen Bunch Date: Tue, 19 Aug 2014 08:00:17 -0700 Subject: [PATCH] docs(ngModelOptions): mention that it's inherited Closes #9096 Closes #7212 --- src/ng/directive/ngInclude.js | 15 ++++++++++++--- test/ng/directive/ngIncludeSpec.js | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js index 7c6f0856e714..eef3a8a94f51 100644 --- a/src/ng/directive/ngInclude.js +++ b/src/ng/directive/ngInclude.js @@ -150,6 +150,9 @@ * @eventType emit on the scope ngInclude was declared in * @description * Emitted every time the ngInclude content is requested. + * + * @param {Object} angularEvent Synthetic event object. + * @param {String} src URL of content to load. */ @@ -159,6 +162,9 @@ * @eventType emit on the current ngInclude scope * @description * Emitted every time the ngInclude content is reloaded. + * + * @param {Object} angularEvent Synthetic event object. + * @param {String} src URL of content to load. */ @@ -168,6 +174,9 @@ * @eventType emit on the scope ngInclude was declared in * @description * Emitted when a template HTTP request yields an erronous response (status < 200 || status > 299) + * + * @param {Object} angularEvent Synthetic event object. + * @param {String} src URL of content to load. */ var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce', function($templateRequest, $anchorScroll, $animate, $sce) { @@ -236,15 +245,15 @@ var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', '$sce currentScope = newScope; currentElement = clone; - currentScope.$emit('$includeContentLoaded'); + currentScope.$emit('$includeContentLoaded', src); scope.$eval(onloadExp); }, function() { if (thisChangeId === changeCounter) { cleanupLastIncludeContent(); - scope.$emit('$includeContentError'); + scope.$emit('$includeContentError', src); } }); - scope.$emit('$includeContentRequested'); + scope.$emit('$includeContentRequested', src); } else { cleanupLastIncludeContent(); ctrl.template = null; diff --git a/test/ng/directive/ngIncludeSpec.js b/test/ng/directive/ngIncludeSpec.js index e3f366be6e7e..dd640de2086a 100644 --- a/test/ng/directive/ngIncludeSpec.js +++ b/test/ng/directive/ngIncludeSpec.js @@ -121,7 +121,7 @@ describe('ngInclude', function() { element = $compile('
')($rootScope); $rootScope.$digest(); - expect(contentRequestedSpy).toHaveBeenCalledOnce(); + expect(contentRequestedSpy).toHaveBeenCalledOnceWith(jasmine.any(Object), 'url'); $httpBackend.flush(); })); @@ -139,7 +139,7 @@ describe('ngInclude', function() { element = $compile('
')($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); }));