mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
Merge branch 'bootstrap-refactor' into 2.0
This commit is contained in:
@ -68,7 +68,7 @@ import {Scroll} from '../scroll/scroll';
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* You can add slides to a `@Page` using the following template:
|
||||
* You can add slides to a `@Component` using the following template:
|
||||
*
|
||||
* ```html
|
||||
* <ion-slides>
|
||||
@ -87,9 +87,10 @@ import {Scroll} from '../scroll/scroll';
|
||||
* To add [options](#configuring), we will define them in `mySlideOptions` in our class `MyPage`:
|
||||
*
|
||||
* ```ts
|
||||
* import {Page, Slides} from 'ionic-angular';
|
||||
* import {Component} from '@angular/core';
|
||||
* import {Slides} from 'ionic-angular';
|
||||
*
|
||||
* @Page({
|
||||
* @Component({
|
||||
* templateUrl: 'my-page.html'
|
||||
* })
|
||||
* class MyPage {
|
||||
|
@ -1,12 +1,12 @@
|
||||
import {ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Http} from '@angular/http';
|
||||
import {App, Slides} from '../../../../../src';
|
||||
import {ionicBootstrap, Slides} from '../../../../../src';
|
||||
|
||||
|
||||
@App({
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class MyApp {
|
||||
class E2EApp {
|
||||
mySlideOptions: any;
|
||||
images: string[] = [];
|
||||
@ViewChild(Slides) slider: Slides;
|
||||
@ -42,3 +42,5 @@ class MyApp {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {ViewChild} from '@angular/core';
|
||||
import {App, Page, Slides} from '../../../../../src';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {ionicBootstrap, Slides} from '../../../../../src';
|
||||
|
||||
|
||||
@App({
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class MyPage {
|
||||
@ -12,10 +12,6 @@ class MyPage {
|
||||
loop: false
|
||||
};
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
||||
}
|
||||
|
||||
onSlideChanged() {
|
||||
let previousIndex = this.slider.getPreviousIndex();
|
||||
let currentIndex = this.slider.getActiveIndex();
|
||||
@ -49,9 +45,12 @@ class MyPage {
|
||||
}
|
||||
}
|
||||
|
||||
@App({
|
||||
|
||||
@Component({
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
class E2EApp {
|
||||
root: any = MyPage;
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
|
@ -1,18 +1,8 @@
|
||||
import {App, Page, NavController} from '../../../../../src';
|
||||
import {Component} from '@angular/core';
|
||||
import {ionicBootstrap, NavController} from '../../../../../src';
|
||||
|
||||
|
||||
@App({
|
||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||
})
|
||||
class MyApp {
|
||||
rootPage;
|
||||
|
||||
constructor() {
|
||||
this.rootPage = IntroPage;
|
||||
}
|
||||
}
|
||||
|
||||
@Page({
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class IntroPage {
|
||||
@ -52,7 +42,7 @@ class IntroPage {
|
||||
}
|
||||
}
|
||||
|
||||
@Page({
|
||||
@Component({
|
||||
template: `
|
||||
<ion-navbar *navbar>
|
||||
<ion-title>Slides</ion-title>
|
||||
@ -64,6 +54,14 @@ class IntroPage {
|
||||
|
||||
`
|
||||
})
|
||||
class MainPage {
|
||||
class MainPage {}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
class E2EApp {
|
||||
root = IntroPage;
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
|
@ -1,10 +1,11 @@
|
||||
import {ViewChild} from '@angular/core';
|
||||
import {App, Slides} from '../../../../../src';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {ionicBootstrap, Slides} from '../../../../../src';
|
||||
|
||||
@App({
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class MyApp {
|
||||
class E2EApp {
|
||||
slides: any[];
|
||||
@ViewChild('loopSlider') loopSlider: Slides;
|
||||
startingIndex: number;
|
||||
@ -42,3 +43,5 @@ class MyApp {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ionicBootstrap(E2EApp);
|
||||
|
@ -1,11 +1,10 @@
|
||||
import {App} from '../../../../../src';
|
||||
import {Component} from '@angular/core';
|
||||
import {ionicBootstrap} from '../../../../../src';
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html',
|
||||
directives: []
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class MyApp {
|
||||
constructor() {
|
||||
class E2EApp {}
|
||||
|
||||
}
|
||||
}
|
||||
ionicBootstrap(E2EApp);
|
||||
|
Reference in New Issue
Block a user