Skip to content

[Do not merge] Add input-fields classes example #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { ModalTest, ModalTestWithPushStrategy, ModalContent } from "./modal/moda
import { ModalViewMainPageComponent } from "./modal/modal-view-main-page";
import { LazyLoadModalComponent } from "./modal/lazy/lazy-load-modal.component";

import { InputFieldsComponents } from "./classes/input-fields.components";

import { TabViewComponent } from "./tab-view/tab-view.component";

import { NavigationOptionsComponent } from "./navigation-options/navigation-options.component";
Expand Down Expand Up @@ -61,6 +63,8 @@ export const routableComponents = [
ModalTestWithPushStrategy,
LazyLoadModalComponent,

InputFieldsComponents,

TabViewComponent,

NavigationOptionsComponent,
Expand Down Expand Up @@ -98,6 +102,8 @@ export const routes = [
{ path: 'modal/modal-dialogs-push', component: ModalTestWithPushStrategy, data: { title: "modal(onPush)" } },
{ path: 'modal/lazy', component: LazyLoadModalComponent, data: { title: "modal(lazy)" } },

{ path: 'input-fields', component: InputFieldsComponents, data: { title: "input-fields", isNavigatable: true } },

{ path: 'tab-view', component: TabViewComponent, data: { title: "tab-view", isNavigatable: true } },

{ path: 'nav-options', component: NavigationOptionsComponent, data: { title: "nav-options", isNavigatable: true} },
Expand Down
29 changes: 29 additions & 0 deletions app/classes/input-fields.components.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<StackLayout>

<!--checked-value-accessor.ts-->
<Switch [(ngModel)]="switch" #sw></Switch>
<Label [text]="sw.className"></Label>

<!--date-value-accessor.ts-->
<!--ERROR TypeError: Cannot read property 'getDay' of undefined-->
<DatePicker [(ngModel)]="dataPicker" #dp></DatePicker>
<Label [text]="dp.className"></Label>

<!--number-value-accessor.ts-->
<Slider [(ngModel)]="slider" #sl></Slider>
<Label [text]="sl.className"></Label>

<!--selectedIndex-value-accessor.ts-->
<SegmentedBar [items]="items" selectedIndex="2" [(ngModel)]="segmentedBar" #sb></SegmentedBar>
<Label [text]="sb.className"></Label>

<!--text-value-accessor.ts-->
<TextField [(ngModel)]="textField" #tf></TextField>
<Label [text]="tf.className"></Label>

<!--time-value-accessor.ts-->
<!--ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'getHours' of null-->
<TimePicker [(ngModel)]="timePicker" #tp></TimePicker>
<Label [text]="tp.className"></Label>

</StackLayout>
28 changes: 28 additions & 0 deletions app/classes/input-fields.components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component } from "@angular/core";
import { DatePicker } from "ui/date-picker";
import { SegmentedBarItem } from "ui/segmented-bar";

@Component({
selector: "input-fields",
moduleId: module.id,
templateUrl: "./input-fields.components.html",
})
export class InputFieldsComponents {
switch = true;
dataPicker;
slider = 10;
segmentedBar;
textField;
timePicker;

public items: Array<SegmentedBarItem>;

constructor() {
this.items = [];
for (let i = 1; i < 4; i++) {
const item = new SegmentedBarItem();
item.title = "Tab " + i;
this.items.push(item);
}
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
},
"scripts": {
"ns-bundle": "ns-bundle",
"start-android-bundle": "npm run ns-bundle --android --start-app",
"start-ios-bundle": "npm run ns-bundle --ios --start-app",
"build-android-bundle": "npm run ns-bundle --android --run-app",
"build-ios-bundle": "npm run ns-bundle --ios --run-app",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app"
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
}
}