简体   繁体   中英

Simple login system UserController

I have the following:

a login route in app.js that sets success: false if invalid password or username.

but for some reason in the actual login html the authentication process is completely ignored.

Am I missing something?

You are using an href. You need to have a button of a submit type to submit the form.

Change your <div class="form-login" ng-submit="login()"> line to: <form class="form-login" ng-submit="login()"> . That will tell Angular this is a form. Then, change your closing </div> to </form> as well.

<span class="group-btn">     
  <button type="submit" class="btn btn-primary btn-md">
    login <i class="fa fa-sign-in"></i>
  </button>
</span>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM