Skip to content

Instantly share code, notes, and snippets.

@Exlord
Last active August 29, 2015 14:22
Show Gist options
  • Save Exlord/f44cad8019cc65ba2063 to your computer and use it in GitHub Desktop.
Save Exlord/f44cad8019cc65ba2063 to your computer and use it in GitHub Desktop.
Attach a global event handler for $ViewContentLoaded in Angular 1.3
(function (angular) {
var origMethod = angular.module;
angular.module = function (name, reqs, configFn) {
var module = origMethod(name, reqs, configFn);
module.run(function ($rootScope) {
$rootScope.$on('$viewContentLoaded', function () {
var appEl = angular.element(' [ng-view],ng-view,.ng-view', '[ng-app="' + name + '"]');
});
});
return module;
};
})(angular);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment