Advertisement
Guest User

Untitled

a guest
May 15th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <form action="/" method="post">
  2. <input type"email" name="email" />
  3. <input type"password" name="password" />
  4. <input type="submit" value="login" />
  5. </form>
  6.  
  7. <form >
  8. <input type"email" ng-model="user.email" />
  9. <input type"password" ng-model="user.password" />
  10. <button ng-click="login">login</button>
  11. </form>
  12.  
  13. $scope.user = {};
  14. $scope.login= function () {
  15. $http({
  16. url: 'http://localhost:3000/',
  17. method: 'POST',
  18. data: {
  19. email: user.email,
  20. password:user.password
  21. }
  22. });
  23. });
  24.  
  25. router.post('/', function (req, res, next) {
  26. console.log(req.body);
  27. //custom authentication or use passport.js
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement