For example, I have a controller to show user a list view, some columns need data comes from another endpoint, so I wrote these with intuition, could you tell me how do I re-factory them?
$http.get($scope.urlA)
  .success(function(res){
    $scope.dataA = res.data;
    $http.get($scope.urlB)
      .success(function(res){
        $scope.dataB = res.data;
      })
      .error(function(err){
        if (err) throw err;
      });
  })
  .error(function(err){
    if (err) throw err;
  });

$http.get($scope.urlB)require anything in$http.get($scope.urlA)?