Html 表单在选择时仍提交必需的内容

Html 表单在选择时仍提交必需的内容,html,angular,Html,Angular,我目前正忙于一个angular应用程序,我有一个表单有一些下拉列表。即使在第一个选项为空时将其设置为必需,表单仍会提交 </mat-card-header> <mat-card-content fxLayout="column" fxLayoutAlign="center"> <mat-form-field> <mat-select placeholder="Vehi

我目前正忙于一个angular应用程序,我有一个表单有一些下拉列表。即使在第一个选项为空时将其设置为必需,表单仍会提交

        </mat-card-header>
        <mat-card-content fxLayout="column" fxLayoutAlign="center">
            <mat-form-field>
                <mat-select placeholder="Vehicle Type" [(ngModel)]="VehicleAdd.Vehicle_Type" name="Type" required>
                    <option value="" disabled selected>Choose</option>
                    <mat-option *ngFor="let type of types" [value]="type">
                        {{type}}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </mat-card-content>
    </mat-card>
有什么想法吗

        </mat-card-header>
        <mat-card-content fxLayout="column" fxLayoutAlign="center">
            <mat-form-field>
                <mat-select placeholder="Vehicle Type" [(ngModel)]="VehicleAdd.Vehicle_Type" name="Type" required>
                    <option value="" disabled selected>Choose</option>
                    <mat-option *ngFor="let type of types" [value]="type">
                        {{type}}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </mat-card-content>
    </mat-card>

        </mat-card-header>
        <mat-card-content fxLayout="column" fxLayoutAlign="center">
            <mat-form-field>
                <mat-select placeholder="Vehicle Type" [(ngModel)]="VehicleAdd.Vehicle_Type" name="Type" required>
                    <option value="" disabled selected>Choose</option>
                    <mat-option *ngFor="let type of types" [value]="type">
                        {{type}}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </mat-card-content>
    </mat-card>
我认为问题是禁用的,当检查表单有效性时,禁用的元素将被“传递”。 尝试:

        </mat-card-header>
        <mat-card-content fxLayout="column" fxLayoutAlign="center">
            <mat-form-field>
                <mat-select placeholder="Vehicle Type" [(ngModel)]="VehicleAdd.Vehicle_Type" name="Type" required>
                    <option value="" disabled selected>Choose</option>
                    <mat-option *ngFor="let type of types" [value]="type">
                        {{type}}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </mat-card-content>
    </mat-card>