Joe
Joe

Reputation: 459

How to know when AngularJS digest cycle ends without using $timeout?

This is a general question about AngularJS.

AngularJS does not raise an event to notify when the digest cycle has ended. AngularJS suggests using $timeout as a solution to queue your work to be run after the current digest cycle (also waits for DOM rendering to be completed by the browser).

Does anyone know how to know if $scope.$apply() and $scope.$digest() have ended without using $timeout?

Upvotes: 0

Views: 228

Answers (1)

Veysel Erdemci
Veysel Erdemci

Reputation: 61

You can use $scope.$digest(), before your business logic function or $scope.$apply(function(){/*your business*/}) but this method like timeout function.

Upvotes: 0

Related Questions