Im trying to learn the basics with AngularJS and trying to make a text visible when a number is big enough. It looks like the more() function is only called once, when the page is displayed first time. The lessThan3() function returns the correct value, but it doesnt work when trying ng-hide.
AngularJS
function ApplicationController($scope,$interval) {
$scope.number = 0;
$interval(function() {
$scope.number++;
}, 1000);
$scope.lessThan3 = function(){
return ($scope.number < 3);
}
}
Html
Number: {{ number }}
{{ lessThan3() }}
<p ng-hide="{{ lessThan3 }}">
Less than 3
</p>
link to code: http://jsfiddle.net/bBaa2/71/