我们必须在 mat-expansion-panel 中显示一个表单。表单中有多个字段,其中一些我使用 mat-select,另外一些我使用 mat-input。
在扩展面板中, matInput 工作正常,但 mat-select 没有显示选择可能值的选项。
虽然 mat-select 在正常显示时工作正常。
<mat-expansion-panel>
<mat-expansion-panel-header>
Heading 1
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Select">
<mat-option value="1">option 1</mat-option>
<mat-option value="2">option 2</mat-option>
<mat-option value="3">option 3</mat-option>
<mat-option value="4">option 4</mat-option>
</mat-select>
</mat-form-field>
</mat-expansion-panel>
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏。
角度ng重复和角度材料md-virtual-repeat之间的区别?
我什么时候应该使用一个或另一个?
我正在使用ZingChart.render()方法渲染散点图.它工作正常,给我预期的结果.
我希望在图形渲染完成后执行一些代码.由于JS代码以异步方式执行,因此我想在图形渲染之后执行的代码在渲染图形之前执行.
在JS/ZingChart中是否有任何方法可以在ZingChart渲染完成后成功执行某些代码.
SampleCode.js
zingchart.render({
id:'chartDiv',
data:chartData,
height:400,
width:600
});
Run Code Online (Sandbox Code Playgroud)
ZingChart渲染完成后需要执行的采样行
performance.now()
Run Code Online (Sandbox Code Playgroud)
问候
阿贾伊
我正在使用angular5 reactivemodule在我的应用程序中显示一个表单.我还使用了必需的验证器,随后将该字段设置为红色并向用户显示错误信息.
它按预期工作,但是当我使用重置表单时
this.form.reset()
表单显示了需要特定字段的验证错误.我还使用form.markAsPristine()或form.markAsUntouched()来使其工作,但在应用多个可能的对的组合后问题仍然存在.
example.html的
<form [formGroup]="checkForm" (ngSubmit)="submitForm()">
<mat-form-field>
<input matInput formControlName="name" placeholder="name" />
<mat-error *ngIf="checkForm.get('name').errors?.required">
Name is required.
</mat-error>
</mat-form-field>
<mat-form-field>
<input matInput formControlName="email" placeholder="email" />
<mat-error *ngIf="checkForm.get('email').errors?.required">
Name is required.
</mat-error>
</mat-form-field>
<button [disabled]="checkForm.invalid" type="submit">add</button>
</form>
Run Code Online (Sandbox Code Playgroud)
example.ts
checkForm = this.formBuilder.group({
'name': ['', Validators.required],
'email': ['', Validators.required]
});
submitForm() {
this.checkForm.reset();
// this.checkForm.markAsPristine();
this.checkForm.markAsUntouched();
}
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏.