mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Form basic test
This commit is contained in:
1
ionic/components/form/test/basic/e2e.js
Normal file
1
ionic/components/form/test/basic/e2e.js
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
9
ionic/components/form/test/basic/main.html
Normal file
9
ionic/components/form/test/basic/main.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<form (^submit)="doSubmit($event)" [control-group]="form">
|
||||
<ion-input>
|
||||
<input control="email" type="email" placeholder="Your email">
|
||||
</ion-input>
|
||||
<ion-input>
|
||||
<input control="password" type="password" placeholder="Your password">
|
||||
</ion-input>
|
||||
<button ion-button stable block type="submit">Submit</button>
|
||||
</form>
|
||||
20
ionic/components/form/test/basic/main.js
Normal file
20
ionic/components/form/test/basic/main.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {Component, View, bootstrap} from 'angular2/angular2'
|
||||
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
|
||||
import {Button, Form, Input, Content} from 'ionic/ionic';
|
||||
|
||||
@Component({ selector: '[ion-app]' })
|
||||
@View({
|
||||
templateUrl: 'main.html',
|
||||
directives: [FormDirectives, Button, Input, Content]
|
||||
})
|
||||
class IonicApp {
|
||||
constructor() {
|
||||
var fb = new FormBuilder();
|
||||
this.form = fb.group({
|
||||
email: ['', Validators.required],
|
||||
password: ['', Validators.required],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap(IonicApp)
|
||||
Reference in New Issue
Block a user