aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/ngInclude.js
diff options
context:
space:
mode:
authorMatthieu Larcher2013-05-02 21:12:00 +0200
committerPete Bacon Darwin2013-05-03 19:55:47 +0100
commitaf0eaa304748f330739a4b0aadb13201126c5407 (patch)
treeb6780f190feab2e12ba2eabd292f9290ead78900 /src/ng/directive/ngInclude.js
parenta348e90aa141921b914f87ec930cd6ebf481a446 (diff)
downloadangular.js-af0eaa304748f330739a4b0aadb13201126c5407.tar.bz2
feat(ngInclude): $includeContentRequested event
Adding a $includeContentRequested event in order to better keep track of how many includes are sent and be able to compare it with how many have finished.
Diffstat (limited to 'src/ng/directive/ngInclude.js')
-rw-r--r--src/ng/directive/ngInclude.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js
index 45800e75..730c7bdf 100644
--- a/src/ng/directive/ngInclude.js
+++ b/src/ng/directive/ngInclude.js
@@ -116,6 +116,16 @@
/**
* @ngdoc event
+ * @name ng.directive:ngInclude#$includeContentRequested
+ * @eventOf ng.directive:ngInclude
+ * @eventType emit on the scope ngInclude was declared in
+ * @description
+ * Emitted every time the ngInclude content is requested.
+ */
+
+
+/**
+ * @ngdoc event
* @name ng.directive:ngInclude#$includeContentLoaded
* @eventOf ng.directive:ngInclude
* @eventType emit on the current ngInclude scope
@@ -170,6 +180,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
}).error(function() {
if (thisChangeId === changeCounter) clearContent();
});
+ scope.$emit('$includeContentRequested');
} else {
clearContent();
}