我正在使用angular5和angular material2.我想删除所需字段的星号或星号.我还想在占位符之前添加自定义星号或星号.
<mat-form-field> <input matInput placeholder="Applicant Name" name="inputApplicantName" [(ngModel)]="inputApplicantName" required> </mat-form-field>
解决方法
从输入中删除“required”属性;
用mat-form-field中的标记替换占位符属性,并尝试使用它的样式;
用mat-form-field中的标记替换占位符属性,并尝试使用它的样式;
A placeholder is a text label displayed in the input area when the input does not contain text. When text is present,the placeholder will float above the input area. The placeholder can be specified either via a placeholder attribute on the input or a < mat-placeholder > element in the same form field as the matInput