Advertisement
Guest User

Untitled

a guest
Apr 5th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. app.factory('userFactory', ['$http', function($http){
  2. var userFactory = {};
  3. var username;
  4. var password;
  5.  
  6. userFactory.getList = function() {
  7. console.log("success");
  8. return $http.get('http://localhost:3000/user');
  9. };
  10.  
  11. userFactory.setUser = function(name,pass) { //for use after authentication throughout the project
  12. username = name;
  13. password = pass;
  14. }
  15.  
  16. userFactory.getUser = function() {
  17. if(username != null){
  18. return username;
  19. }
  20. }
  21.  
  22. return userFactory;
  23. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement