This is because there is a synthax change in the new angular version. @ViewChild("password", { static: true }) password: ElementRef; @ViewChild("confirmPassword", { static: true }) confirmPassword: ElementRef;