mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
Form and aside flex
This commit is contained in:
@ -1,9 +1,14 @@
|
||||
<ion-aside #aside [content]="content">
|
||||
<ion-list inset>
|
||||
<ion-item *ng-for="#c of components" (^click)="openPage(aside, c)">
|
||||
{{c.title}}
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<ion-toolbar>
|
||||
<ion-title>Ionic 2.0</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-content>
|
||||
<ion-list inset>
|
||||
<ion-item *ng-for="#c of components" (^click)="openPage(aside, c)">
|
||||
{{c.title}}
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-aside>
|
||||
|
||||
<ion-nav #content [initial]="firstPage"></ion-nav>
|
||||
|
@ -3,7 +3,9 @@ import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import {List, Item, ActionMenu, Modal, ModalRef,
|
||||
import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/forms';
|
||||
|
||||
import {List, Item, Input, ActionMenu, Modal, ModalRef,
|
||||
NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic';
|
||||
|
||||
@Component({
|
||||
@ -23,11 +25,31 @@ import {List, Item, ActionMenu, Modal, ModalRef,
|
||||
Ionic comes with a variety of useful from controls, like
|
||||
text inputs, text areas, toggle switches, and sliders.
|
||||
</p>
|
||||
<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 primary block type="submit">Submit</button>
|
||||
</form>
|
||||
</ion-content>
|
||||
`,
|
||||
directives: [NavbarTemplate, Navbar, Content, List, Item]
|
||||
directives: [formDirectives, NavbarTemplate, Navbar, Content, List, Item, Input, Button]
|
||||
})
|
||||
export class FormPage {
|
||||
constructor() {
|
||||
var fb = new FormBuilder()
|
||||
|
||||
this.form = fb.group({
|
||||
email: ['', Validators.required],
|
||||
password: ['', Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
doSubmit(event) {
|
||||
console.log('Submitted:', this.form.value);
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/fo
|
||||
import {Segment, SegmentButton, List, Item, ActionMenu, Modal, ModalRef,
|
||||
NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic';
|
||||
|
||||
console.log('imporrted', formDirectives, Segment, SegmentButton);
|
||||
|
||||
@Component({
|
||||
selector: 'ion-view'
|
||||
})
|
||||
|
@ -10,6 +10,9 @@ $aside-shadow: -1px 0px 2px rgba(0, 0, 0, 0.2), 1px 0px 2px rgba(0,0,0,0.2) !def
|
||||
|
||||
background: $aside-background;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
&[type=overlay] {
|
||||
z-index: $z-index-aside-overlay;
|
||||
|
Reference in New Issue
Block a user