Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12141

Carousel styles not loading in primeng 16

$
0
0

I have a simple project with Angular and Primeng 16

I use the carousel, everything is fine, but as soon as I press the next or prev button, the information does not load.

I have put all its style dependencies in the styles section of Angular.json

"styles": ["node_modules/primeicons/primeicons.css","node_modules/primeflex/primeflex.min.css","node_modules/primeng/resources/primeng.min.css","src/styles.scss"            ],

And also my code example is like this

html file

<div class="card"><p-carousel [value]="products" [numVisible]="3" [numScroll]="3" [circular]="false"        [responsiveOptions]="responsiveOptions"><ng-template let-product pTemplate="item"><h4 class="mb-1">{{ product.name }}</h4></ng-template></p-carousel></div>

typescript file

  products : any[] | undefined;  responsiveOptions: any[] | undefined;  ngOnInit() {    this.responsiveOptions = [      {        breakpoint: '1199px',        numVisible: 1,        numScroll: 1      },      {        breakpoint: '991px',        numVisible: 2,        numScroll: 1      },      {        breakpoint: '767px',        numVisible: 1,        numScroll: 1      }    ];    this.products = [      {name : 7},      {name : 8},      {name : 9},      {name : 0},      {name : 1},      {name : 2},      {name : 3}    ]  }

Viewing all articles
Browse latest Browse all 12141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>