ionic2 + cordova 应用-表单
4.1 静态页面login.html(欢迎加入Q群一起学习讨论657185219)
<ion-content padding> <form [formGroup]="loginForm" > <ion-item> <ion-label>Username</ion-label> <ion-input type="text" formControlName="LoginID"></ion-input> </ion-item> <!-- 有问题的提示语 --> <p *ngIf="!loginForm.controls.LoginID.valid && loginForm.controls.LoginID.touched" color="danger">LoginID must is email.</p> <!-- <p *ngIf="loginForm.controls.LoginID.valid && loginForm.controls.LoginID.touched" secondary> LoginID is good</p>--> <ion-item> <ion-label>Password</ion-label> <ion-input type="password" formControlName="LoginPwd"></ion-input> </ion-item> <ion-item> <button ion-button (click)="login(loginForm.value, $event)" [disabled]="!loginForm.valid">登录</button> <button ion-button (click)="signup()">注册</button> </ion-item> </form> </ion-content>主要使用了[formGroup],loginForm.controls 俩个属性
相关推荐
genglang 2018-08-17
半纸药笺 2019-06-28
templateUrl:'build/app.html',<ion-navid="nav"[root]="rootPage"#contentswipe-back-enabled="false"
codewhile 2016-03-24
庆华 2019-06-26
nickking 2019-06-25
samllcat 2019-06-25
samllcat 2019-06-25
庆华 2019-06-25
nickking 2019-06-25
nickking 2019-06-25
庆华 2019-06-21
rimuweinuan 2019-06-21
chenxiangpeng 2019-06-21
rimuweinuan 2019-06-20
samllcat 2019-06-20
nickking 2017-12-01
半纸药笺 2017-08-23
malonely 2017-06-23