问题
There are multiple pages (Home & Product detail page) in my application and each page has carousel with multiple images . When i browse application home page whole page is loaded and all js & carousel js working fine and carousel initialized without any error .
But when i clicks on any product detail page then angular updates center part of page while header & footer remains same .
Issue - carousel is not initialized at product detail page and all images display individually instead of carousel .
- All js & css are include in src/app/index.html not in angular.json
回答1:
It depends on how you are rendering your carousel in angular code, try using owl-carousel with angular 6 .
Install a package using npm install ngx-owl-carousel owl.carousel jquery --save
For more details please refer:- https://medium.com/@biswa8998/owl-carousel-with-angular-6-banner-slider-and-image-carousel-3b3ded0070c5
来源:https://stackoverflow.com/questions/55547088/image-slider-carousel-not-render-while-user-move-from-one-page-to-other-angu