I would like make a countDown with Angular js. this is my code:
Html File
{{countDown}}
You probably didn't declare your module correctly, or you put the function before the module is declared (safe rule is to put angular module after the body, once all the page is loaded). Since you're using angularjs, then you should use $interval (angularjs equivalence to setInterval which is a windows service).
Here is a working solution:
angular.module('count', [])
.controller('countController', function($scope, $interval) {
$scope.countDown = 10;
$interval(function() {
console.log($scope.countDown--);
}, 1000, $scope.countDown);
});
{{countDown}}
Note: it stops at 0 in the html view, but at 1 in the console.log, can you figure out why? ;)