mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
refactor(demos): give each component section its own view
This commit is contained in:
23
demos/component-docs/forms/forms.html
Normal file
23
demos/component-docs/forms/forms.html
Normal file
@ -0,0 +1,23 @@
|
||||
<ion-navbar *navbar class="show-navbar">
|
||||
<ion-title>Forms</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content class="has-header components-demo">
|
||||
<form (submit)="processForm($event)" [ng-form-model]="form">
|
||||
<ion-list>
|
||||
<ion-input>
|
||||
<input ng-control="firstName" type="text" placeholder="First Name">
|
||||
</ion-input>
|
||||
<ion-input>
|
||||
<input ng-control="lastName" type="text" placeholder="Last Name">
|
||||
</ion-input>
|
||||
</ion-list>
|
||||
<div class="padding">
|
||||
<button block type="submit">Create Account</button>
|
||||
</div>
|
||||
</form>
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
|
25
demos/component-docs/forms/forms.ts
Normal file
25
demos/component-docs/forms/forms.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/forms';
|
||||
import {IonicView} from 'ionic/ionic';
|
||||
|
||||
|
||||
@IonicView({
|
||||
templateUrl: 'forms/forms.html',
|
||||
bindings: [FormBuilder]
|
||||
})
|
||||
export class FormsPage {
|
||||
|
||||
constructor() {
|
||||
this.form = new ControlGroup({
|
||||
firstName: new Control("", Validators.required),
|
||||
lastName: new Control("", Validators.required)
|
||||
});
|
||||
}
|
||||
|
||||
processForm(event) {
|
||||
// TODO: display input in a popup
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user