aboutsummaryrefslogtreecommitdiffstats
path: root/src/directive/ngInclude.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/directive/ngInclude.js')
-rw-r--r--src/directive/ngInclude.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/directive/ngInclude.js b/src/directive/ngInclude.js
index 08b14488..68a03d35 100644
--- a/src/directive/ngInclude.js
+++ b/src/directive/ngInclude.js
@@ -63,6 +63,16 @@
</doc:scenario>
</doc:example>
*/
+
+
+/**
+ * @ngdoc event
+ * @name angular.module.ng.$compileProvider.directive.ng:include#$includeContentLoaded
+ * @eventOf angular.module.ng.$compileProvider.directive.ng:include
+ * @eventType emit on the current ng:include scope
+ * @description
+ * Emitted every time the ng:include content is reloaded.
+ */
var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile',
function($http, $templateCache, $anchorScroll, $compile) {
return {
@@ -70,6 +80,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
compile: function(element, attr) {
var srcExp = attr.src,
scopeExp = attr.scope || '',
+ onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
return function(scope, element, attr) {
@@ -106,7 +117,8 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}
- scope.$emit('$contentLoaded');
+ scope.$emit('$includeContentLoaded');
+ scope.$eval(onloadExp);
}
}).error(clearContent);
} else {