Destroying controller in angular
I have a function like this, in an AngularJS controller
$timeout($scope.loadPosts, 5000); // pull every 5 seconds
When I navigate away from the controller (to another view), how can I stop
the timeout and eventually destroy the controller so it is not running
anymore?
No comments:
Post a Comment