Angularjs Promise.all not updating scope, while $q.all does

1.2k views Asked by At

I am using Angularjs 1.3.7 and just discovered that Promise.all does not update angularjs view after a successful response, while $q.all does. Is this later changed since Promises are included in native javascript or what is the reason behind this?

1

There are 1 answers

1
MattJ On BEST ANSWER

As IAmDranged mentions in a comment:

Probably yeah, because the Promise API is not integrated with the angular mechanism - meaning essentially that it doesn't trigger a digest cycle at key point of the lifecycle of the promises. Try adding a $scope.$apply() at the end of the Promise.all() callback function to trigger a digest cycle manually.

It was confirmed that Promise.all does not trigger a digest cycle.