function login(email, password, callback) {

      $http.post('/api/login', { email: email, password: password })
         .success(function (res) {
            callback({ success: res.success, email: email, token: res.token, id: res._id});
         });

    }
// Use the email and password to login. The Callback will receive and object with the username and token
Use the email and password to login. The Callback will receive and object with the username and token
Use the email and password to login . The Callback will receive and object with the username and token
function login(email, password, callback) {
      $http.post('/api/login', { email: email, password: password })
         .success(function (res) {
            callback({ success: res.success, email: email, token: res.token, id: res._id});
         });
    }
function login ( email , password , callback ) { $http . post ( '/api/login' , { email : email , password : password } ) . success ( function ( res ) { callback ( { success : res . success , email : email , token : res . token , id : res . _id } ) ; } ) ; }
Use the email and password to login.
Use the email and password to login .