title: Use ViewChild for dynamic elements - Angular 2 & ionic 2
body: <p>I want to use multiple <a href="https://ionicframework.com/docs/api/components/slides/Slides/" rel="nofollow noreferrer">IonicSlides</a> that I added dynamically. But I can't use <code>@viewChild</code>. please suggest a way to resolve this problem.</p>
  <p><strong>Template.html :</strong></p>
  <pre><code>&lt;div *ngFor=&quot;let name of title;let i = index;&quot;&gt;
      &lt;ion-slides  id=&quot;something&quot; #slides&gt;
          //some code
      &lt;/ion-slides&gt;
  &lt;/div
  </code></pre>
  <p><strong>Component.ts :</strong></p>
  <pre><code>  @ViewChild('slides') slides: QueryList&lt;Slides&gt;;
  
    ....
  
    ngAfterViewInit(){
          setTimeout(()=&gt;{
                alert(this.slides.toArray()); //this line rise error 
          }, 3000);
    }
  </code></pre>
  <p><strong>Error :</strong></p>
  <blockquote>
  <p>_this.slides.toArray is not a function</p>
  </blockquote>