A.Nasri
A.Nasri

Reputation: 21

Angular 5/Implementing ngx carousel

I am running Angular 5.2.4 and installed ngx-carousel "ngx-carousel": "^1.3.5"

What I have:

<ngx-carousel class="banner" [inputs]="carouselBanner" (carouselLoad)="carouselBannerLoad()">
<ngx-item NgxCarouselItem *ngFor="let tile of carouselBannerItems; let i = index;">
    <div class="bannerStyle" [style.background]="'url(' + tile + ')'">
        <h1>{{i}}</h1>
    </div>
</ngx-item>
<button NgxCarouselPrev class="leftRs">&lt;</button>
<button NgxCarouselNext class="rightRs">&gt;</button>

I have a template parse errors in the console saying:

Can't bind to 'inputs' since it isn't a known property of 'ngx-carousel'.
  1. If 'ngx-carousel' is an Angular component and it has 'inputs' input, then verify that it is part of this module.

  2. If 'ngx-carousel' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

What am I doing wrong?

Upvotes: 0

Views: 3185

Answers (2)

BlizZard
BlizZard

Reputation: 579

In app.module.ts add import { CarouselModule } from 'ngx-bootstrap/carousel';

then in imports add CarouselModule.forRoot()

You are not importing the modules in the main app.module.ts, thus getting error.

Upvotes: 0

Shilpa J
Shilpa J

Reputation: 51

You need to import NgxCarouselModule to your module. Then the issue will be solved.

In your module, add in imports section.

Upvotes: 1

Related Questions