I'm new to Angularjs and want to add a timer once the page load. I read a number of similar kind of questions here but still I couldn't resolve my issue. I added data-ng-init="init()"
to my view.
This is the controller:
'use strict';
angular.module('tempApp')
.controller('MainController',['$scope','$timeout','dService', function ($scope,$timeout, dService) {
$scope.init = function(){
console.log("Safety checkStatus page load");
$timeout(callAtTimeout(),3000);
}
function callAtTimeout(){
console.log("Safety checkStatus ***");
}
}]);
jsfiddle: https://jsfiddle.net/Zusee/s6xy48t0/9/
Here dService is separate service js file I'm going to use. Any help would be appreciated.