I have a Login Form which has email and password fields.
I\'ve chosen for browser autofill.
The problems is: When browser autofills login form, both fields are p
Had the same problem too. I'm not sure if this is the best way, but I was able to get it to work by adding AfterViewChecked
import { Component, AfterViewChecked } from "@angular/core";
export class LoginComponent implements AfterViewChecked {
// Beware! Called frequently!
// Called in every change detection cycle anywhere on the page
ngAfterViewChecked() {
console.log(`AfterViewChecked`);
if (this.usr.userName) {
// enable to button here.
console.log("found username in AfterViewChecked");
}
}
}
or you might be able to try Angular2's other Lifecycle Hooks https://embed.plnkr.co/?show=preview