2016-08-10 5 views
0
I have Confusion in $digest when we need to used ? But $apply I think we need when angular js into any element have outside scope then we use $apply and update it with value. 

$ digestは同じ意味ですが、どのように使用するのですか、私たちは違った使い方をしました。

このコードでは、内部的に$ digestを呼び出します。

+0

<ボタンNGクリック= "updateTimeは()">時刻を更新 - NG-クリック< /button> $ scope.updateTime =関数(){$ scope.data.time =新しいDate(); } – VjyV

答えて

1

$apply() - 内部で$digestを呼び出しています。ちょうど違いは、$スコープから始まり、すべての子要素(モデル)にアクセスし、$ digestを呼び出している点です。

+0

rootscopeは$ digest cycleを開始しますか? – VjyV

関連する問題