AngularJS视图在模型更改时不更新

24 浏览
0 Comments

AngularJS视图在模型更改时不更新

我正在尝试弄清楚Angular的工作原理,但在模型更改时,我的视图无法更新。

HTML

  
        

{{testValue}}

JS

var app = angular.module('test', []);
    app.controller('TestCtrl', function ($scope) {
       $scope.testValue = 0;
        setInterval(function() {
            console.log($scope.testValue++);
        }, 500);
    });

http://jsfiddle.net/N2G7z/

有什么想法吗?

0