如何在Ionic 3中验证文本区域的最小长度?Maxlength工作得很好,但奇怪的是minLength不能工作。
<ion-textarea id="emailBody" minlength="2" rows="3" required maxLength="500" type="text" [(ngModel)]="emailBody"></ion-textarea>
发布于 2018-06-02 00:15:15
我使用了一些Krishna Rathore和我发现的一些东西。
感谢你在正确的方向上的推动。
<div class="padding-left-right-10" *ngIf="!passedEmailTextCheck">
email text is required.
</div>
ts文件
if (!passedEmailText) {
this.passedEmailTextCheck = false;
} else {
// javascript值检查
if( value ) {
}
will evaluate to true if value is not:
null
undefined
NaN
empty string ''
0
false
typescript includes javascript rules.
https://stackoverflow.com/questions/50636377
复制相似问题