I am looking for advice on how to optimize my controller in order to run a periodic ajax call every 15 seconds instead of just once. Additionally, I am wondering how I can stop the call when needed.
myApp.controller('myCntrl', function($window,$scope,$http,$routeParams,$location) {
$http({
method: 'GET',
url: '../ajax/my_script.php',
})
.success(function(data, status, headers, config) {
console.log(data)
})
})