Angular.js factory: Handle $http asynchronously
The problem:
When I was using $http service to get data from a remote API, my code below was not able to return data back to the controller.
myApp.factory('myFactory', function($http){
var data = { anArray:[] };
$http.get('/api').success(funct...
victorleungtw.hashnode.dev1 min read