-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(slides): expose more options (#9992)
* feat(slides): expose more options Closes #9988 Exposes slidesPerView and spaceBetween. Also documents how to change unexposed options * docs(slides): update advanced usage
- Loading branch information
1 parent
24d0052
commit 2d26edb
Showing
3 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Component, ViewChild, NgModule } from '@angular/core'; | ||
import { IonicApp, IonicModule, Slides } from '../../../..'; | ||
|
||
|
||
@Component({ | ||
templateUrl: 'main.html' | ||
}) | ||
export class E2EPage { | ||
@ViewChild(Slides) slider: Slides; | ||
|
||
onSlideWillChange(s: Slides) { | ||
console.log(`onSlideWillChange: ${s}`); | ||
} | ||
|
||
onSlideDidChange(s: Slides) { | ||
console.log(`onSlideDidChange: ${s}`); | ||
} | ||
|
||
onSlideDrag(s: Slides) { | ||
console.log(`onSlideDrag: ${s}`); | ||
} | ||
|
||
} | ||
|
||
@Component({ | ||
template: '<ion-nav [root]="root"></ion-nav>' | ||
}) | ||
export class E2EApp { | ||
root = E2EPage; | ||
} | ||
|
||
@NgModule({ | ||
declarations: [ | ||
E2EApp, | ||
E2EPage | ||
], | ||
imports: [ | ||
IonicModule.forRoot(E2EApp) | ||
], | ||
bootstrap: [IonicApp], | ||
entryComponents: [ | ||
E2EApp, | ||
E2EPage | ||
] | ||
}) | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
<ion-slides style="background: black" | ||
(ionSlideWillChange)="onSlideWillChange($event)" | ||
(ionSlideDidChange)="onSlideDidChange($event)" | ||
(ionSlideDrag)="onSlideDrag($event)" | ||
pager="true" | ||
effect="slide" | ||
paginationType="progress" | ||
slidesPerView="2" | ||
spaceBetween="40"> | ||
|
||
<ion-slide style="background: red; color: white;"> | ||
<h1>Slide 1</h1> | ||
</ion-slide> | ||
|
||
<ion-slide style="background: white; color: blue;"> | ||
<h1>Slide 2</h1> | ||
</ion-slide> | ||
|
||
<ion-slide style="background: blue; color: white;"> | ||
<h1>Slide 3</h1> | ||
</ion-slide> | ||
|
||
<ion-slide style="background: purple; color: white;"> | ||
<h1>Slide 4</h1> | ||
</ion-slide> | ||
|
||
<ion-slide style="background: aqua; color: black;"> | ||
<h1>Slide 5</h1> | ||
</ion-slide> | ||
|
||
<ion-slide style="background: goldenrod; color: white;"> | ||
<h1>Slide 6</h1> | ||
</ion-slide> | ||
|
||
</ion-slides> |