Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. admin.factory('expenseFact', ['$http', function($http) {
  2. var expense = {};
  3.  
  4. this.expenses = "";
  5.  
  6. expense.getExpenseList = function() {
  7. this.expenses = $http({
  8. headers: {
  9. 'Content-Type': 'application/x-www-form-urlencoded'
  10. },
  11. method: "GET",
  12. url: base_url + "rest/expenses"
  13. });
  14.  
  15. return this.expenses;
  16. };
  17.  
  18. return expense;
  19. }]);
  20.  
  21. admin.controller('expenseLandCtrl', function ($scope,$rootScope,expenseFact) {
  22. $scope.pageTitle = $rootScope.pageTitle;
  23.  
  24. expenseFact.getExpenseList().then(function (data) {
  25. $scope.expenses = data.data;
  26. });
  27.  
  28. });
  29.  
  30. admin.controller('expenseAddCtrl', function ($scope,$rootScope,expenseFact) {
  31. $scope.pageTitle = $rootScope.pageTitle;
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement