angularjs - when to use $scope.$apply in angular -


i little confused how $scope.$apply , digest loops function. understand, since digest loops runs @ regular intervals , not always, can force digest loop run on scope variables want update immediately. in description here, it's given $scope.$apply should used when async call made, variables can updated. doubt if digest loop doesn't run always, how scope variables instantaneously updated in view/controller?

simply, use $scope.$apply() whenever you're outside angular scope. example within settimeout function, outside world of angular.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -