javascript - Ionic angularjs $http module is not get data -
in anguler js if used 2 times $http in single function so, affect fetching data web services.
like :- .factory('chats', function($http) { $http{} $http{} });
fetching data using 2 $http calls not problem , not interfere each other because called asynchronously.
this great because means both called without 1 having wait other complete.
you should know, however, because of results of second call before results of first call. might happen if have long call (large amount of data) in first $http , short 1 (small amount of data). if want wait both completed before proceeding can use $q.all wait both complete before proceeding. can read more here: https://www.jonathanfielding.com/combining-promises-angular/
Comments
Post a Comment