AngularJS "debounce" 用于 ngBind

AngularJS "debounce" for ngBind

对于 ngModel 有一个 ngModelOptions 例如 ng-model-options="{ debounce: 1000 }"

ngBind 或 {{}} 有类似的东西吗?

基本上,我使用 ng-bind 将一些数据绑定到 div 元素,并且作为 Angular.js 的默认行为,数据在 div 元素上更新为一旦它在模型中更新。每当模型中的数据发生变化时,我想延迟 div 上的更新或数据绑定。这样当模型($scope)中的数据发生更改时,此更改应该仅在 div 元素上显示 2 秒后出现。如何实现?

是我的错。我在考虑更新视图,但正如@DanPantry 所建议的,我尝试使用超时延迟 value/model 更新,因为该值在几毫秒后更新,其余的由 angular.js $digest 周期。 :)

例如我做了类似下面的事情:

$timeout(function () {
            $rootScope.$apply(function () {
                $rootScope.current.index = idx;
            });
        }, 100);