rename IonicView to Page

This commit is contained in:
Tim Lancina
2015-10-07 13:44:53 -05:00
parent ea2647123a
commit 26e3554d56
14 changed files with 47 additions and 47 deletions

View File

@@ -1,15 +1,15 @@
import {App, IonicApp, IonicView, NavController} from 'ionic/ionic';
import {App, IonicApp, Page, NavController} from 'ionic/ionic';
@IonicView({templateUrl: 'page1.html'})
@Page({templateUrl: 'page1.html'})
class Page1 {}
@IonicView({templateUrl: 'page3.html'})
@Page({templateUrl: 'page3.html'})
class Page3 {}
@IonicView({templateUrl: 'page2.html'})
@Page({templateUrl: 'page2.html'})
class Page2 {
constructor(nav: NavController) {
this.nav = nav;

View File

@@ -1,7 +1,7 @@
import {App, IonicApp, IonicView} from 'ionic/ionic';
import {App, IonicApp, Page} from 'ionic/ionic';
@IonicView({templateUrl: 'page1.html'})
@Page({templateUrl: 'page1.html'})
class Page1 {}

View File

@@ -1,7 +1,7 @@
import {App, IonicApp, IonicView} from 'ionic/ionic';
import {App, IonicApp, Page} from 'ionic/ionic';
@IonicView({templateUrl: 'page1.html'})
@Page({templateUrl: 'page1.html'})
class Page1 {}

View File

@@ -1,4 +1,4 @@
import {App, IonicView, IonicApp, IonicConfig, IonicPlatform} from 'ionic/ionic';
import {App, Page, IonicApp, IonicConfig, IonicPlatform} from 'ionic/ionic';
import {Modal, ActionSheet, NavController, NavParams, Animation} from 'ionic/ionic';
@@ -44,7 +44,7 @@ class MyAppCmp {
}
}
@IonicView({
@Page({
template: '<ion-nav [root]="rootView"></ion-nav>'
})
export class ContactModal {
@@ -76,7 +76,7 @@ export class ContactModal {
}
@IonicView({
@Page({
template: `
<ion-navbar *navbar><ion-title>First Page Header</ion-title><ion-nav-items primary><button class="e2eCloseMenu" (click)="closeModal()">Close</button></ion-nav-items></ion-navbar>
<ion-content padding>
@@ -146,7 +146,7 @@ export class ModalFirstPage {
}
@IonicView({
@Page({
template: `
<ion-navbar *navbar><ion-title>Second Page Header</ion-title></ion-navbar>
<ion-content padding>

View File

@@ -4,7 +4,7 @@ import {Ion} from '../ion';
import {Icon} from '../icon/icon';
import {ToolbarBase} from '../toolbar/toolbar';
import {IonicConfig} from '../../config/config';
import {IonicView} from '../../config/decorators';
import {Page} from '../../config/decorators';
import {IonicApp} from '../app/app';
import {ViewController} from '../nav/view-controller';
import {NavController} from '../nav/nav-controller';

View File

@@ -74,7 +74,7 @@ import * as util from 'ionic/util';
* <h2 id="creating_views">View creation</h2>
* Views are created when they are added to the navigation stack. For methods
* like [push()](#push), the NavController takes any component class that is
* decorated with [@IonicView](../../../config/IonicView/) as its first
* decorated with [@Page](../../../config/Page/) as its first
* argument. The NavController then [compiles]() that component, adds it to the
* DOM in a similar fashion to Angular's [DynamicComponentLoader](https://angular.io/docs/js/latest/api/core/DynamicComponentLoader-interface.html),
* and animates it into view.
@@ -87,10 +87,10 @@ import * as util from 'ionic/util';
*
* <h2 id="Lifecycle">Lifecycle events</h2>
* Lifecycle events are fired during various stages of navigation. They can be
* defined in any `@IonicView` decorated component class.
* defined in any `@Page` decorated component class.
*
* ```ts
* @IonicView({
* @Page({
* template: 'Hello World'
* })
* class HelloWorld {

View File

@@ -17,7 +17,7 @@ import {NavRegistry} from './nav-registry';
* Where `pushPage` and `params` are specified in your component:
* ```ts
* import {LoginPage} from 'login';
* @IonicView({
* @Page({
* template: `<button [nav-push]="pushPage" [nav-params]="params"></button>`
* })
* class MyPage {

View File

@@ -1,9 +1,9 @@
import {App, NavController} from 'ionic/ionic';
import {IonicView, IonicConfig, IonicApp} from 'ionic/ionic';
import {Page, IonicConfig, IonicApp} from 'ionic/ionic';
import {NavParams, NavController} from 'ionic/ionic';
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title><ion-segment><ion-segment-button>Friends</ion-segment-button><ion-segment-button>Enemies</ion-segment-button></ion-segment></ion-title>' +
@@ -53,7 +53,7 @@ class FirstPage {
}
@IonicView({
@Page({
template: `
<ion-content padding>
<h1>Second page</h1>
@@ -97,7 +97,7 @@ class SecondPage {
}
@IonicView({
@Page({
template: `
<ion-navbar *navbar><ion-title>Third Page Header</ion-title></ion-navbar>
<ion-content padding>

View File

@@ -1,9 +1,9 @@
import {RouteConfig, Location} from 'angular2/router';
import {App, IonicView, NavParams, ViewController} from 'ionic/ionic';
import {App, Page, NavParams, ViewController} from 'ionic/ionic';
@IonicView({templateUrl: 'view1.html'})
@Page({templateUrl: 'view1.html'})
class View1Cmp {
constructor(location: Location, viewCtrl: ViewController) {
this.path = location.path();
@@ -16,7 +16,7 @@ class View1Cmp {
}
@IonicView({templateUrl: 'view2.html'})
@Page({templateUrl: 'view2.html'})
class View2Cmp {
constructor(location: Location, viewCtrl: ViewController) {
this.path = location.path();
@@ -29,7 +29,7 @@ class View2Cmp {
}
@IonicView({templateUrl: 'view3.html'})
@Page({templateUrl: 'view3.html'})
class View3Cmp {
constructor(params: NavParams, location: Location, viewCtrl: ViewController) {
this.id = params.get('id');

View File

@@ -43,7 +43,7 @@ import * as dom from 'ionic/util/dom';
* You can select tabs programatically by injecting Tabs into any child
* component, and using the [select()](#select) method:
* ```ts
* @IonicView({
* @Page({
* template: `<button (click)="goToTabTwo()">Go to Tab2</button>`
* })
* class TabOne {

View File

@@ -1,9 +1,9 @@
import {RouteConfig, Location} from 'angular2/router';
import {App, IonicView, NavController} from 'ionic/ionic';
import {App, Page, NavController} from 'ionic/ionic';
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Sign In</ion-title>' +
@@ -25,7 +25,7 @@ class SignIn {
}
@IonicView({
@Page({
templateUrl: './tabs.html'
})
class TabsPage {
@@ -40,7 +40,7 @@ class TabsPage {
//
// tab 1
//
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 1 Page 1</ion-title>' +
@@ -62,7 +62,7 @@ class Tab1Page1 {
}
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 1 Page 2</ion-title>' +
@@ -85,7 +85,7 @@ class Tab1Page2 {
}
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 1 Page 3</ion-title>' +
@@ -107,7 +107,7 @@ class Tab1Page3 {
//
// tab 2
//
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 2 Page 1</ion-title>' +
@@ -129,7 +129,7 @@ class Tab2Page1 {
}
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 2 Page 2</ion-title>' +
@@ -152,7 +152,7 @@ class Tab2Page2 {
}
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 2 Page 3</ion-title>' +
@@ -174,7 +174,7 @@ class Tab2Page3 {
//
// tab 3
//
@IonicView({
@Page({
template: '' +
'<ion-navbar *navbar>' +
'<ion-title>Tabs 3</ion-title>' +

View File

@@ -1,9 +1,9 @@
import {App, IonicView, NavController} from 'ionic/ionic';
import {App, Page, NavController} from 'ionic/ionic';
//
// Tab 1
//
@IonicView({
@Page({
template: `
<ion-navbar *navbar>
<ion-title>Heart</ion-title>
@@ -22,7 +22,7 @@ class Tab1 {
//
// Tab 2
//
@IonicView({
@Page({
template: `
<ion-navbar *navbar>
<ion-title>Star</ion-title>
@@ -41,7 +41,7 @@ class Tab2 {
//
// Tab 3
//
@IonicView({
@Page({
template: `
<ion-navbar *navbar>
<ion-title>Stopwatch</ion-title>

View File

@@ -7,7 +7,7 @@ import {IONIC_DIRECTIVES} from './directives';
/**
* @private
*/
class IonicViewImpl extends View {
class PageImpl extends View {
constructor(args = {}) {
args.directives = (args.directives || []).concat(IONIC_DIRECTIVES);
super(args);
@@ -15,7 +15,7 @@ class IonicViewImpl extends View {
}
/**
* The IonicView decorator indicates that the decorated class is an Ionic
* The Page decorator indicates that the decorated class is an Ionic
* navigation view, meaning it can be navigated to using a [NavController](../../Nav/NavController/#creating_views)
*
* Ionic views have all [IONIC_DIRECTIVES](../IONIC_DIRECTIVES/), which include
@@ -25,7 +25,7 @@ class IonicViewImpl extends View {
* your Ionic views:
*
* ```ts
* @IonicView({
* @Page({
* template: '<ion-checkbox my-custom-dir>' +
* '</ion-checkbox>'
* directives: [MyCustomDirective]
@@ -69,10 +69,10 @@ class IonicViewImpl extends View {
* in your templates.
*
*/
export function IonicView(args) {
export function Page(args) {
return function(cls) {
var annotations = Reflect.getMetadata('annotations', cls) || [];
annotations.push(new IonicViewImpl(args));
annotations.push(new PageImpl(args));
Reflect.defineMetadata('annotations', annotations, cls);
return cls;
}
@@ -136,7 +136,7 @@ export function App(args={}) {
args.template = '<ion-nav></ion-nav>';
}
annotations.push(new IonicViewImpl(args));
annotations.push(new PageImpl(args));
// redefine with added annotations
Reflect.defineMetadata('annotations', annotations, cls);

View File

@@ -35,7 +35,7 @@ import {ShowWhen, HideWhen} from '../components/show-hide-when/show-hide-when';
/**
* The core Ionic directives as well as Angular's CORE_DIRECTIVES and
* FORM_DIRECTIVES. Automatically available in every IonicView template.
* FORM_DIRECTIVES. Automatically available in every Page template.
*/
export const IONIC_DIRECTIVES = [
// Angular