Topic: Carousel is not working with Angular Universal
Gaurav Garg
pro asked 7 years ago
Gaurav Garg
pro answered 7 years ago
Damian Gemza staff commented 7 years ago
Thanks for your solution! We'll add this to our docs. Best Regards, Damian
Gaurav Garg
pro answered 7 years ago
Gaurav Garg
pro answered 7 years ago
Gaurav Garg
pro answered 7 years ago
Damian Gemza staff commented 7 years ago
Dear Guarav, please read about using static images in Universal. Here's some links: http://dev.sebastienlucas.com/how-to-use-the-angular-universal-starter/ https://scotch.io/tutorials/server-side-rendering-in-angular-2-with-angular-universal I'll add this section to our tutorial. Best Regards, Damian
Gaurav Garg
pro answered 7 years ago
Hi
I guess i found one more issue in carousel
this code is working with universal because interval is equal to 0.[interval]="0"
<mdb-carousel [interval]="0" [isControls]="true" class="carousel slide carousel-fade" [type]="'carousel-thumbnails'" [animation]="'fade'">
<!--First slide-->
<mdb-slide *ngFor="let image of images">
<imgclass="d-block w-100"src="{{imageBaseURL}}{{image}}"alt="First slide">
</mdb-slide>
</mdb-carousel>
---------------------------------------------------------------------------------------------------------------------------
but this code is not working with universal because i am using variable to initialize interval. May be reason is setInterval method.
public myInterval: number = 3000;
<mdb-carousel [interval]="myInterval" [isControls]="true" class="carousel slide carousel-fade" [type]="'carousel-thumbnails'" [animation]="'fade'">
<!--First slide-->
<mdb-slide *ngFor="let image of images">
<imgclass="d-block w-100"src="{{imageBaseURL}}{{image}}"alt="First slide">
</mdb-slide>
</mdb-carousel>
Gaurav Garg
pro answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Damian Gemza staff commented 7 years ago
Dear Guarav, do your console or terminal throws you any errors or warnings?