Trying my hand at Angualar and Typescript for the first time. I am working on creating a login page where users can move to another page if their credentials are correct. To achieve this, I want to use a function that is triggered by clicking a button. However, my current implementation doesn't seem to be working as expected.
Here is a snippet of my code:
<button type="submit" id="btnLog" (click)="log(userName.value , password.value )" routerLink="/home" >
In app.component.ts file:
log(uName , uPass) {
//Validation Part
if((name==uName) && (pass==uPass)){
attrInvalid.innerHTML="routerLink=/\"home\""
}else{
attrInvalid.innerHTML="Invalid UserName or Password"
}
}