Open rabac opened 5 years ago
how are your component? it's with mutiple
i'm trying to create a chart carousel with multiple slides being dinamycally creted. I'm using *ngFor
to create the <slide #slides>
tag inside the caroulsel and getting then in my component with ViewChildren('slides') slides: QueryList<ViewContainerRef>
the *ngFor
is to create slides with the number of components returned by a http get.
The only problem i'm having is to use createComponent( )
method with my queryList elements through forEach
. The angular changes the type of my queryList<ViewContainerRef>
to SlideComponent.
I think we can help each other
I solved my problem with the component returned by ViewChildren using {read: ViewContainerRef}. Now it's returning a ViewContainerRef for each one of QueryList children.
Hi This is a question. In the example for line chart on your homepage, you use @ViewChild to get a reference to the chart object. What if you have multiple charts in the same component. How can I get a reference to a specific chart using ViewChild. And secondly, whats the benefit of using ng2-charts compared with the charts wrapper from bootstrap-md module (which has a mdbChart directive). thanks rajesh.