且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AngularJS ng-show和$ timeout不起作用

更新时间:1970-01-01 07:57:54

中断功能

函数立即在调用return的点停止.

A function immediately stops at the point where return is called.

返回后,您永远不会调用超时,请最后移动它

After return you timeout is never invoking, move it in the end

  if (myAnswer == $scope.rightAns){

      $timeout(function () {
                $scope.myAnswer = false;
            }, 3000);
     return true;
    }