In jQuery we can do
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
...
});
What's the equivalent in angular? I really need to wait for all ajax calls finish then do stuff. Thanks.
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
- Keeping track of variable instances
You can use
$q.all
to handle multiple promises. Also, use $http to make the calls, that's more angular.Here is a nice tutorial:
https://egghead.io/lessons/angularjs-q-all
Hope that helps.
The equivalent would be:
AngularJS Documentation for $q