Skip to content
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

ionic2 RC5 with ion-slides issue #9988

Closed
sidjoshi001 opened this issue Jan 12, 2017 · 5 comments
Closed

ionic2 RC5 with ion-slides issue #9988

sidjoshi001 opened this issue Jan 12, 2017 · 5 comments
Assignees

Comments

@sidjoshi001
Copy link

sidjoshi001 commented Jan 12, 2017

Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x

I'm submitting a ... (check one with "x")
[x] bug report
[x] feature request

In RC 5, You guys have been removed option attribute method from ion-slides, Now how I can implement slidesPerView or freeMode ? Helper me here...!!

till RC4 I am working like this..!!

public bannerOptions = { loop: true, slidesPerView: 2, freeMode: true, spaceBetween: 5};

but now what should I do ??

I am also trying like below but still not working..!!

@ViewChild('bannerSlider') bannerSlider: Slides;

constructor() {}

ionViewWillEnter(){
 this.bannerSlider.slidesPerView = '2';
}

Html

<ion-slides #bannerSlider>
 <ion-slide *ngFor="let banner of mainBanner.banners">
  <img src="{{mainBanner.imagePath+banner.image}}">
 </ion-slide>
</ion-slides>

and I also refer http://ionicframework.com/docs/v2/api/components/slides/Slides/#input-properties, but there are slidesPerView and spaceBetween not available & also not working

waiting..!!

@chrisbenseler
Copy link

chrisbenseler commented Jan 12, 2017

Same thing here.
Can't set slides per view anymore and now there seems to not have a way to access the Slides methods passing a callback, such as 'onTransitionEnd'

@mhartington
Copy link
Member

@chrisbenseler Yes there are, look at the output event sections

http://ionicframework.com/docs/v2/api/components/slides/Slides/#output-events
ionSlideDidChange should suffice

mhartington added a commit that referenced this issue Jan 12, 2017
Closes #9988
Exposes slidesPerView and spaceBetween. Also documents how to change
unexposed options
@mhartington mhartington self-assigned this Jan 12, 2017
@mhartington mhartington added the v2 label Jan 12, 2017
brandyscarney pushed a commit that referenced this issue Jan 12, 2017
* feat(slides): expose more options
Closes #9988
Exposes slidesPerView and spaceBetween. Also documents how to change
unexposed options

* docs(slides): update advanced usage
@AishApp
Copy link

AishApp commented Jan 13, 2017

Facing similar issue here. I used onlyExternal and autoplayDisableOnInteraction functions in RC4 using options. In RC5, if i add it in inside html, it is not working.

@brandyscarney
Copy link
Member

Hey everyone, please take a look at the advanced usage section to add properties that are not inputs: http://ionicframework.com/docs/v2/nightly/api/components/slides/Slides/#advanced

If it's defined in the source as an @Input, see autoplay for example, https://github.com/driftyco/ionic/blob/master/src/components/slides/slides.ts#L155-L162, it will work by adding it to the <ion-slides> component.

If it's a property of Slides, it will need to be defined like the advanced usage example above, see freeMode: https://github.com/driftyco/ionic/blob/master/src/components/slides/slides.ts#L398

If you see any properties missing please create an issue for us to get them added. Thanks. :)

@chrisbenseler
Copy link

@brandyscarney thanks, that worked like a charm!

JKust had to use ViewChild and with the slider's instance, inside ionViewDidEnter I can set properties to the slider and subscribe to its events :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants