作为我的新角度。我只想从 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)
};