All model modifications in asynchronous operation callbacks that are not known to Angular need to use the apply method to explicitly notify angular to update the view. For details, see Angular's documentation on apply.
In addition, if angular is in the process of updating (digest circle) and apply is called, the following error will appear:
Error: $apply already in progress
In order to avoid this error, you can first determine the current status and directly use the following encapsulated method:
https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply
All model modifications in asynchronous operation callbacks that are not known to Angular need to use the apply method to explicitly notify angular to update the view. For details, see Angular's documentation on apply.
In addition, if angular is in the process of updating (digest circle) and apply is called, the following error will appear:
In order to avoid this error, you can first determine the current status and directly use the following encapsulated method:
When you need to set the model, just:
For more details about this error, check out this question on stackoverflow