Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="/" method="post">
- <input type"email" name="email" />
- <input type"password" name="password" />
- <input type="submit" value="login" />
- </form>
- <form >
- <input type"email" ng-model="user.email" />
- <input type"password" ng-model="user.password" />
- <button ng-click="login">login</button>
- </form>
- $scope.user = {};
- $scope.login= function () {
- $http({
- url: 'http://localhost:3000/',
- method: 'POST',
- data: {
- email: user.email,
- password:user.password
- }
- });
- });
- router.post('/', function (req, res, next) {
- console.log(req.body);
- //custom authentication or use passport.js
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement