button fixes

This commit is contained in:
Adam Bradley
2015-06-19 12:51:18 -05:00
parent 4e947f216d
commit 21c1b550ef
21 changed files with 128 additions and 319 deletions

View File

@@ -15,17 +15,17 @@ import {SecondPage} from './pages/second-page'
'<ion-navbar *navbar>' +
'<ion-title>First Page: {{ val }}</ion-title>' +
'<ion-nav-items primary>' +
'<button class="button">P1</button>' +
'<button>P1</button>' +
'</ion-nav-items>' +
'<ion-nav-items secondary>' +
'<button class="button">S1</button>' +
'<button>S1</button>' +
'<button icon><i class="icon ion-navicon"></i></button>' +
'</ion-nav-items>' +
'</ion-navbar>' +
'<ion-content class="padding">' +
'<p>First Page: {{ val }}</p>' +
'<p><button class="button" (click)="push()">Push (Go to 2nd)</button></p>' +
'<p><button class="button" [push-data]="pushData" [nav-push]="pushPage">Push w/ nav-push (Go to 2nd)</button></p>' +
'<p><button (click)="push()">Push (Go to 2nd)</button></p>' +
'<p><button [push-data]="pushData" [nav-push]="pushPage">Push w/ nav-push (Go to 2nd)</button></p>' +
'<icon class="ion-ios-arrow-back"></icon>' +
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +

View File

@@ -1,99 +0,0 @@
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
import {Routable, Router, NavController, NavbarTemplate, Navbar, NavPush, Content} from 'ionic/ionic';
import {IonicApp} from '../index';
import {SecondPage} from './second-page';
@Component({
selector: 'ion-view',
lifecycle: [onInit]
})
@View({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>First Page: {{ val }}</ion-title>' +
'<ion-nav-items primary>' +
'<button class="button">P1</button>' +
'</ion-nav-items>' +
'<ion-nav-items secondary>' +
'<button class="button">S1</button>' +
'<button class="button">S2</button>' +
'</ion-nav-items>' +
'</ion-navbar>' +
'<ion-content class="padding">' +
'<p>First Page: {{ val }}</p>' +
'<p><button class="button" (click)="push()">Push (Go to 2nd)</button></p>' +
'<p><button class="button" [push-data]="pushData" [nav-push]="pushPage">Push w/ nav-push (Go to 2nd)</button></p>' +
'<icon class="ion-ios-arrow-back"></icon>' +
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
'</ion-content>',
directives: [NavbarTemplate, Navbar, NavPush, Content]
})
export class FirstPage {
constructor(
nav: NavController
) {
// TODO: Shouldn't have to do this
Router.setNavController(nav);
this.nav = nav;
this.val = Math.round(Math.random() * 8999) + 1000;
this.pushPage = SecondPage;
this.pushData = {
id: 420
}
}
onInit() {
}
viewLoaded() {
this.router = FirstPage.router.invoke(this);
console.log('viewLoaded first page');
}
viewWillEnter() {
console.log('viewWillEnter first page');
}
viewDidEnter() {
console.log('viewDidEnter first page');
}
viewWillLeave() {
console.log('viewWillLeave first page');
}
viewDidLeave() {
console.log('viewDidLeave first page');
}
viewWillCache() {
console.log('viewWillCache first page');
}
viewDidCache() {
console.log('viewDidCache first page');
}
viewWillUnload() {
console.log('viewWillUnload first page');
}
viewDidUnload() {
console.log('viewDidUnload first page');
}
push() {
this.nav.push(SecondPage, { id: 8675309, myData: [1,2,3,4] }, { animation: 'ios' });
}
}
new Routable(FirstPage, {
url: '/first-page'
})

View File

@@ -11,13 +11,13 @@ import {ThirdPage} from './third-page';
<ion-navbar *navbar><ion-title>Second Page Header</ion-title></ion-navbar>
<ion-content class="padding">
<p>
<button class="button" (click)="pop()">Pop (Go back to 1st)</button>
<button primary (click)="pop()">Pop (Go back to 1st)</button>
</p>
<p>
<button class="button" nav-pop>Pop with NavPop (Go back to 1st)</button>
<button primary nav-pop>Pop with NavPop (Go back to 1st)</button>
</p>
<p>
<button class="button" (click)="push()">Push (Go to 3rd)</button>
<button primary (click)="push()">Push (Go to 3rd)</button>
</p>
<p>
Random: {{ val }}

View File

@@ -10,7 +10,7 @@ import {Router, Routable, NavController, NavbarTemplate, Navbar, Content} from '
<ion-navbar *navbar><ion-title>Third Page Header</ion-title></ion-navbar>
<ion-content class="padding">
<p>
<button class="button" (click)="pop()">Pop (Go back to 2nd)</button>
<button primary (click)="pop()">Pop (Go back to 2nd)</button>
</p>
<div class="yellow"><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f></div>
</ion-content>