i'm trying make some test app in anguar.js, but faced with the problem. My js file contain:
live = angular.module('live',[]);
live.controller('printCtrl', function() {
this.test = [];
var thizzz = this;
this.getTest = function() {
return this.test;
};
setInterval(function() {
thizzz.test.push(Date.now());
}, 1000);
}
);
My html file contain:
<div class="content" ng-app="live">
<div ng-controller="printCtrl as print">
<div ng-repeat="t in print.getTest()">
{{t}}
</div>
</div>
</div>
But i don't see anything. Why?
------------- UPDATE ---------------
I'm change my js file like this:
live = angular.module('live',[]);
live.controller('printCtrl', function() {
this.test = [1, 2, 3];
var thizzz = this;
this.getTest = function() {
console.log('INSIDE');
return this.test;
};
setInterval(function() {
thizzz.test.push(Date.now());
}, 1000);
}
);
and html without any changes.
I don't see anythink in HTML files, but i see in console, how angular call 2 times getTest function.