AngularJS: two promises from one $http call
问题 I wonder what is the most elegant way to initialize/the objects that I fill from the AJAX call and are used 'concurrently' somewhere in a directive. I have a controller with such snippet: $scope.var1 = {}; $scope.var2 = {}; $http({ url: "/httpService", method: "GET", params: {} }).success(function(data, status) { $scope.var1 = data.some; // (*1) $scope.var2 = data.other; }) I am also using a directive which binds directly to var1: var1 : '=' and inside the directive there is some check on