Closed juanicastellan0 closed 4 years ago
Could you give some code example which can I look for the problem...
landing page: user-cards-carousel: accepted-payment-methods: glide-service: console:
Few things you can try:
user-cards-carousel:
<ngx-glide #userCardsCarouselGlide>...</ngx-glide>
@ViewChild('userCardsCarouselGlide', { static: false }) glide: NgxGlideComponent;
accepted-payment-methods:
<ngx-glide #acceptedPaymentMethodsGlide>...</ngx-glide>
@ViewChild('acceptedPaymentMethodsGlide', { static: false }) glide: NgxGlideComponent;
<ng-container *ngIf="user_comments && user_comments.length > 0">
<ngx-glide #userCardsCarouselGlide>...</ngx-glide>
</ng-container>
Few things you can try:
- Change ViewChild to specific element for example:
user-cards-carousel:
<ngx-glide #userCardsCarouselGlide>...</ngx-glide>
@ViewChild('userCardsCarouselGlide', { static: false }) glide: NgxGlideComponent;
accepted-payment-methods:
<ngx-glide #acceptedPaymentMethodsGlide>...</ngx-glide>
@ViewChild('acceptedPaymentMethodsGlide', { static: false }) glide: NgxGlideComponent;
- Check your data is ready when declaring ngx-glide in HTML of what I see its looking OK but you can also make some extra code and add *ngIf for example:
<ng-container *ngIf="user_comments && user_comments.length > 0"> <ngx-glide #userCardsCarouselGlide>...</ngx-glide> </ng-container>
- Try to replace (buildedBefore)="play()" to (mountedAfter)="play()"
❤️ thanks a lot
I have two ngx glide on a landing page but I am having problems instantiating the second glide since it looks for it by the name of the glideel variable
I wish I could change the name of the variable that declares the main component to be able to instantiate two glides in one place