Browser does not ask to save password Angular application

Viewed 7360

I am working on an Angular application that starts with a login portal. I am using the following template for my login screen:

login.html

    <form method="post" name="form" (ngSubmit)="f.form.valid && login()" #f="ngForm" novalidate>
      <fieldset>
        <p>
          <label>Username</label>
          <input type="text" placeholder="e.g. JohnDoe" [(ngModel)]="model.username" #username="ngModel"
                 name="username" required/>
        </p>

        <p [ngClass]="{ 'has-error': f.submitted && !password.valid }">
          <label>Password</label>
          <input type="password" placeholder="Password" name="password" [(ngModel)]="model.password"
                 #password="ngModel" required/>
        </p>
        <p>
        <input type="submit" [disabled]="loading" class="btn" value="Login">
        </p>
      </fieldset>
    </form>

Unfortunately, whenever a user is logged in, the password manager of Chrome does not ask to store the credentials. Password managers like Lastpass however do offer to store it. What could I improve to fix this?

4 Answers

Try this solution:

Steps to make Google Chrome offer to save (prompt) password for a particular site (for e.g abcd.com) and Auto-login the site with the credentials thus saved.

-> Go to the given URL 'abcd.com'

-> Right-click Page Info and disable 'JavaScript'

-> Reload the page.

-> Enter the credentials (uid,pwd)

-> A prompt appears to save password.

-> Click on Save password.

-> Auto-Login Extension bubble appears on this page.


At this point it is important because the extension 'Auto-Login' (like many other extensions) require JavaScript to be enabled.

-> Re-enable the JavaScript for this page and reload the page.

-> Now Click on the 'Auto-Login' bubble for remembering automatically logging into the site hereafter!


There is no problem with the code. It lies with the browser settings. Code works fine in my firefox brower.

If your using google chrome please check whether autofill settings is switched on.

Steps to check:


  1. Hamburger icon present on the right top of the browser.

  2. Click on settings.

  3. Search for autofill settings. Make sure that it is switched on.

Related