angular.service.$updateView

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Calling $updateView enqueues the eventual update of the view. (Update the DOM to reflect the model). The update is eventual, since there are often multiple updates to the model which may be deferred. The default update delayed is 25 ms. This means that the view lags the model by that time. (25ms is small enough that it is perceived as instantaneous by the user). The delay can be adjusted by setting the delay property of the service.

angular.service('$updateView').delay = 10

The delay is there so that multiple updates to the model which occur sufficiently close together can be merged into a single update.

You don't usually call '$updateView' directly since angular does it for you in most cases, but there are some cases when you need to call it.

NOTE: if you wish to update the view immediately (without delay), you can do so by calling scope.$eval at any time from your code:

scope.$root.$eval()

In unit-test mode the update is instantaneous and synchronous to simplify writing tests.

Dependencies

Methods

Properties