I have created a submit function to handle login,
However VS code crosses through .subscribe and says "Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8." (method) Observable.subscribe(next?: ((value: any) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription (+2 overloads)
I am new to TypeScript and JavaScript and need some help implimenting this fix, it would be much appreciated.
onSubmit(): void {
if (this.loginForm.valid) {
this.auth.login(this.loginForm.value).subscribe(
(result) => {
this.router.navigate(['admin']);
},
(err: Error) => {
alert(err.message)
}
);
Is my code for the function.