Angular 9:由于“无法读取未定义的属性‘$owl’”错误,ngx-owl-carouel 未呈现

Mat*_*a_B 2 owl-carousel angular

我正在尝试在我的项目中实现一个卡片滑块。实际上,我无法弄清楚为什么 ngx-owl-carousel 没有被渲染并给出一个烦人的问题。我一步一步地遵循npm上的指南,并尝试将 Card 示例放入Angular Docs 中

<owl-carousel
    [options]="{items: 3, dots: false, navigation: false}" [items]="professionals"
    [carouselClasses]="['owl-theme', 'row', 'sliding']">
    <div class="item" *ngFor="let professional of professionals;let i = index">
    <mat-card class="example-card">
        <mat-card-header>
        <div mat-card-avatar class="example-header-image"></div>
        <mat-card-title>Shiba Inu</mat-card-title>
        <mat-card-subtitle>Dog Breed</mat-card-subtitle>
        </mat-card-header>
        <img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg"
            alt="Photo of a Shiba Inu">
        <mat-card-content>
        <p>
            The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
            A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
            bred for hunting.
        </p>
        </mat-card-content>
        <mat-card-actions>
        <button mat-button>LIKE</button>
        <button mat-button>SHARE</button>
        </mat-card-actions>
    </mat-card>
    </div>
</owl-carousel>
Run Code Online (Sandbox Code Playgroud)

我还正确导入了 JQuery 和 NGX Carousel(样式表也是如此):

"styles": [
    "src/styles.scss",
    "./node_modules/owl.carousel/dist/assets/owl.carousel.css",
    "./node_modules/owl.carousel/dist/assets/owl.theme.default.css"
],
"scripts": [
   "./node_modules/jquery/dist/jquery.min.js",
   "./node_modules/owl.carousel/dist/owl.carousel.js"
]
Run Code Online (Sandbox Code Playgroud)

但是在浏览器中它不断抛出这个错误(即使里面没有任何对象)。

浏览器控制台错误

小智 6

[items]="professionalsowl-carousel标签中删除。仅当图像数组动态变化时才需要。