Good morning, what happens is the following:
In my controller "MessageListCtrl" I have a $ interval, which makes certain updates every certain time.
I also have the $ routeProvider that handles the following:
}).when('/label/:labelId', {
templateUrl: 'public/partials/message/list.html',
controller: 'MessageListCtrl'
Likewise, I have a menu with several sub-menus, each one with its respective identifier and which calls the previous $ routeProvider.
My problem is that by choosing the different sub-menus, and calling "/ label / 1", "/ label / 2", etc. Instances of the "MessageListCtrl" controller are created, and also new $ interval, without which I can destroy the previous one. The expected thing would be to create a single instance and every time you call that controller the previous $ interval is closed, and thus start a new one.
The previous thing I could handle it when calling "MessageListCtrl" from another controller "XYZ", but not in the case described above.
I hope you can share some experience. Thanks.