Advertisement
Guest User

Untitled

a guest
Jan 5th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. For an angular-firebase setup , I have the following factory
  2.  
  3. .factory('ExpenseResource',function(UserService,$firebase){
  4. var ref=new Firebase("https://asdfsadf.firebaseio.com/company/"+UserService.company_name+'/days/'+UserService.today.toDateString()+'/expenses');
  5. return $firebase(ref);
  6. });
  7.  
  8.  
  9. and in the controller I have
  10.  
  11. $scope.$watch('today',function(d){
  12. //Load all the expenses and advances
  13. ExpenseResource.$asArray().$loaded().then(function (exp) {
  14. $scope.expenses = exp;
  15. });
  16. });
  17.  
  18. But the ExpenseResource does not load for the second time when I change $scope.today : Why is that ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement