加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何删除必填字段中的星号,并在角度2和角度材料2中的占位符之前

发布时间:2020-12-17 17:06:27 所属栏目:安全 来源:网络整理
导读:我正在使用angular5和angular material2.我想删除所需字段的星号或星号.我还想在占位符之前添加自定义星号或星号. mat-form-field input matInput placeholder="Applicant Name" name="inputApplicantName" [(ngModel)]="inputApplicantName" required /mat-
我正在使用angular5和angular material2.我想删除所需字段的星号或星号.我还想在占位符之前添加自定义星号或星号.

<mat-form-field>
      <input matInput placeholder="Applicant Name" name="inputApplicantName" 
      [(ngModel)]="inputApplicantName" required>
 </mat-form-field>

解决方法

从输入中删除“required”属性;
用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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读