Can someone please help me out with this issue? I need to display different types of bills for various tables in my view, and here's what I came up with. But I have a feeling it might not be the best approach.
In my view, I am calling:
Table 1:
{{billsTypeVariableIncome}}
Table 2:
{{billsTypeVariableBills}}
This is how I've set up my controller:
$scope.billsTypeVariableIncome = getBillsByType(1);
$scope.billsTypeVariableBills = getBillsByType(2);
function getBillsByType(bill_type){
$http.get("/api/bills/by/type/"+bill_type).
success(function(data){
return data;
}).
error(function(data){
console.log('Error ' + data);
})
}
I'm new at this, so there's a good chance I'm on the wrong track. Any advice or guidance would be greatly appreciated!