Image Slider / carousel not render while user move from one page to other - Angular 6

梦想与她 提交于 2021-02-11 12:33:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!