These are chat archives for angular/angular-2-ionic-2

9th
Feb 2018
Matt Cairns
@askmattcairns
Feb 09 2018 02:55
hello! i’m looking for help with ionic-slides. I have a series of ion-slides that each have a single component in them
i would like to call a function in the nested component when the slide becomes active
i suppose an onEnter from a specific slide
iomJvaranam
@iomJvaranam
Feb 09 2018 02:56
Hello! I am looking for a concept in ionic 3 multiple components to a lazy loading module
i was facing an error with Did you add it to @NgModule.entryComponents?
at noComponentFactoryError (core.js:3789) .
UncertaintyP
@UncertaintyP
Feb 09 2018 02:59
@askmattcairns <ion-slides (ionSlideDidChange)="slideChanged()">
Matt Cairns
@askmattcairns
Feb 09 2018 03:01
@UncertaintyP if i understand that correctly, it would call a function in the parent, i would like to tell the component nested in a specific slide to do something
something like
<ion-slides>
   <ion-slide (onEnter)=“doSomething()"></ion-slide>
   <ion-slide (onEnter)=“doSomething()"></ion-slide>
   <ion-slide (onEnter)=“doSomething()"></ion-slide>
   <ion-slide (onEnter)=“doSomething()"></ion-slide>
</ion-slides>
well, i suppose that’s not entirely accurate
Matt Cairns
@askmattcairns
Feb 09 2018 03:08
<ion-slides>
  <ion-slide>
    <my-component></my-component>
  </ion-slide>
  <ion-slide>
    <my-component></my-component>
  </ion-slide>
  <ion-slide>
    <my-component></my-component>
  </ion-slide>
</ion-slides>
If I have a set up like this, i would like to run an initialization funtion inside my-component only when its ion-slide component becomes active
UncertaintyP
@UncertaintyP
Feb 09 2018 03:09
Well, its just a wrapper for http://idangero.us/swiper/ and to my knowledge there is no such functionality
(this statement applies to your onEnter question)
Matt Cairns
@askmattcairns
Feb 09 2018 03:11
thanks, i was struggling to figure out how to explain what i’m trying to accomplish. that struggle is also probably why i’m not able to solve it :smile:
UncertaintyP
@UncertaintyP
Feb 09 2018 03:12
You can use ViewChildren to reference your components and call the init function when the slides change
Matt Cairns
@askmattcairns
Feb 09 2018 03:17
oh my! thank you @UncertaintyP! I think you may have just unlocked it for me!