I have a button on my page. When a user clicks the button, it triggers the following code:
as.controller('CustSummary', function($scope, $rootScope, $http, $routeParams, $location)
{
var loadAbbDetails = function()
{
$rootScope.$broadcast('loadDetails');
}
$scope.viewAbbDetails = function()
{
loadAbbDetails();
}
}
I've set up a listener for "loadDetails" in another controller:
as.controller('CustomerCtrl', function($scope, $rootScope, $http, $routeParams, $location)
{
var loadDetails = function()
{
$scope.include = 'partials/customer/customerabbdetails.html';
};
$scope.$on("loadDetails",function(event,args) {
loadDetails();
});
}
I'm curious about how long this listener will be active. Will it be destroyed when loadDetails() is triggered?