mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
0
ionic/components/text-input/test/form-inputs/e2e.ts
Normal file
0
ionic/components/text-input/test/form-inputs/e2e.ts
Normal file
22
ionic/components/text-input/test/form-inputs/index.ts
Normal file
22
ionic/components/text-input/test/form-inputs/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import {App} from 'ionic/ionic';
|
||||
import {FormBuilder, Validators} from 'angular2/angular2';
|
||||
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
constructor(fb: FormBuilder) {
|
||||
this.loginForm = fb.group({
|
||||
username: ["", Validators.required],
|
||||
email: ["", Validators.required],
|
||||
password: ["", Validators.required],
|
||||
comments: ["", Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
submit(ev) {
|
||||
console.log("Submitted", this.loginForm.value);
|
||||
}
|
||||
|
||||
}
|
||||
44
ionic/components/text-input/test/form-inputs/main.html
Normal file
44
ionic/components/text-input/test/form-inputs/main.html
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
<ion-toolbar><ion-title>Inline Label Text Input</ion-title></ion-toolbar>
|
||||
|
||||
|
||||
<ion-content>
|
||||
|
||||
<form (ng-submit)="submit($event)" [ng-form-model]="loginForm">
|
||||
|
||||
<ion-list>
|
||||
<ion-input>
|
||||
<ion-label>Email:</ion-label>
|
||||
<input ng-control="email" type="email">
|
||||
<button clear item-right>
|
||||
<icon mail></icon>
|
||||
</button>
|
||||
</ion-input>
|
||||
|
||||
<ion-input>
|
||||
<ion-label>Username:</ion-label>
|
||||
<input ng-control="username" type="text">
|
||||
<button clear item-right>
|
||||
<icon person></icon>
|
||||
</button>
|
||||
</ion-input>
|
||||
|
||||
<ion-input>
|
||||
<ion-label>Password:</ion-label>
|
||||
<input ng-control="password" type="password">
|
||||
<button clear item-right>
|
||||
<icon lock></icon>
|
||||
</button>
|
||||
</ion-input>
|
||||
|
||||
<ion-input>
|
||||
<ion-label>Comments:</ion-label>
|
||||
<textarea ng-control="comments">Comment value</textarea>
|
||||
</ion-input>
|
||||
</ion-list>
|
||||
|
||||
<button block type="submit">Login</button>
|
||||
|
||||
</form>
|
||||
|
||||
</ion-content>
|
||||
Reference in New Issue
Block a user