I wanted to call a function from $interval's timeout.
angular.module('myApp').factory('myFactory',function($interval){
var stop;
return{
start : function() {
if(angular.isUndefined(stop)){
stop = $interval(function() {
function1();
}
, 30000);
}
},
function1 : function() {
console.log('In function1');
function2();
},
function2 : function() {
console.log('In function2');
}
}
});
error I am getting is
TypeError: undefined is not a function
Please let me know what could be the reason and how to solve the same
Thanks, ng-R