我如何正确使用 mat-form-field 来获取输入值(已更新)

How can i correctly use mat-form-field to get the input values (UPDATED)

link referring the error with textbox above the floating line 我是 mat-form-fields 的新手。我试图通过对我的表单使用 mat-form-field 作为测试来探索它。使用 mat 库时出现文本框边框。这是不寻常的

我尝试使用 mat-form-field 后跟输入标签,但我仍然看到边框

<div fxFlex="120px">
     <label class="studentName">Student Name</label><sup class="red- 
             color">*</sup>
</div>
        <!--<div fxFlex="calc(100% - 135px)" fxLayout="column" >-->
<mat-form-field class="fullWidth">
      <input matInput formControlName="studentName"
             id="studentName"
             name="studentName"
             required>
            <!--<app-error-message [control]="form.controls.studentName"></app-error-message>-->
 </mat-form-field>

我不应该出现文本框,它变成了边框。

我期待这样的事情:https://stackblitz.com/angular/mnrjgnnqmqv?file=app%2Fform-field-overview-example.ts

我的 Css 文件如下:

.alignment .mat-form-field-outline-start,
.alignment .mat-form-field-outline-end {
  border-radius: 0px !important;
}
<mat-form-field class="fullWidth">
    <input matInput placeholder="Student Name" [(ngModel)]='variableName' required>
</mat-form-field>

if you couldn't find the css which is overriding your input add this css

mat-form-field.mat-form-field input {
    border: none !important;
}