Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.factory('userFactory', ['$http', function($http){
- var userFactory = {};
- var username;
- var password;
- userFactory.getList = function() {
- console.log("success");
- return $http.get('http://localhost:3000/user');
- };
- userFactory.setUser = function(name,pass) { //for use after authentication throughout the project
- username = name;
- password = pass;
- }
- userFactory.getUser = function() {
- if(username != null){
- return username;
- }
- }
- return userFactory;
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement