Поскольку я новичок в angular. Я просто хочу получить значение из mat-input, мне нужно получить значение из angular mat-input. Может ли кто-нибудь помочь мне в этом. заранее спасибо
<div fxLayoutAlign= "center center" fxFlexFill class="main-div">
<mat-card fxFlex= "20">
<mat-toolbar color="primary" c>Bonbloc Login</mat-toolbar>
<form fxLayoutAlign="stretch" fxLayout = "column" class="login-form">
<mat-form-field>
<input matInput required [(ngModel)] = "email" placeholder="email Id">
<mat-hint align="end">Min 5 characters</mat-hint>
</mat-form-field>
<mat-form-field>
<input matInput required [(ngModel)] = "password" type="password" placeholder="password">
</mat-form-field>
<button mat-raised-button type="submit" (click) = "login()">Login</button>
<h1>Hi {{email}} {{password}}</h1>
</form>
</mat-card>
login() {
console.log(this.email, this.password)
};
Может быть, это может помочь: stackoverflow.com/questions/20279484/ — person Hari Haran schedule 02.12.2020
