Pagination ngx-owl-carousle-o分页在角度10中不起作用

Pagination ngx-owl-carousle-o分页在角度10中不起作用,pagination,runtime-error,carousel,angular10,Pagination,Runtime Error,Carousel,Angular10,我用Angular 10开发了一个简单的应用程序,其中使用了ngx owl转盘。我对分页有问题。当我尝试单击“下一页”时,它无法按预期工作,出现此错误 ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'translate3d(-297px,0px,0px)'. Current value: 'translate3d(-1488px,0

我用Angular 10开发了一个简单的应用程序,其中使用了ngx owl转盘。我对分页有问题。当我尝试单击“下一页”时,它无法按预期工作,出现此错误

ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'translate3d(-297px,0px,0px)'. Current value: 'translate3d(-1488px,0px,0px)'.
    at throwErrorIfNoChangesMode (core.js:5625)
    at bindingUpdated (core.js:13962)
    at bindingUpdated2 (core.js:13977)
    at bindingUpdated4 (core.js:13986)
    at Module.ɵɵpureFunction5 (core.js:24421)
    at StageComponent_Template (ngx-owl-carousel-o.js:3393)
    at executeTemplate (core.js:7449)
    at refreshView (core.js:7318)
    at refreshComponent (core.js:8465)
    at refreshChildComponents (core.js:7126)
carousel.component.html

    <div class="wrapper">
    <h3 *ngIf="data.products.length !== 0" class="category-title">{{data.title}}</h3>

    <owl-carousel-o (dragging)="isDragging = $event.dragging" [options]="customOptions">

        <ng-container *ngFor="let slide of data.products">
            <ng-template carouselSlide>
                <a *ngIf="slide.product_type == 1 || slide.product_type == 4" [owlRouterLink]="['/animations', slide.id]" [stopLink]="isDragging"  class="image">
                    <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
                    <div class="title">
                        <h4>{{slide.name}}</h4>
                    </div>
                </a>
                <a *ngIf="slide.product_type == 3" [owlRouterLink]="['/animations/collection', slide.id]" [stopLink]="isDragging"  class="image">
                    <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
                    <div class="title">
                        <h4>{{slide.name}}</h4>
                    </div>
                </a>
            </ng-template>
        </ng-container>

    </owl-carousel-o>

</div>

angular 8可以使用,但angular 10不能使用。我还有一个问题,这个布线不起作用,甚至不能点击。

问题是,
*ngIf
指令是滑块中的标签。像这样将
*ngIf
指令放入

<owl-carousel-o (dragging)="isDragging = $event.dragging" [options]="customOptions">
    <ng-template carouselSlide *ngIf="slide.product_type == 1 || slide.product_type == 4">
        <a [owlRouterLink]="['/animations', slide.id]" [stopLink]="isDragging" class="image">
            <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
            <div class="title">
                <h4>{{slide.name}}</h4>
            </div>
        </a>
    </ng-template>

    <ng-template carouselSlide *ngIf="slide.product_type == 3">
        <a [owlRouterLink]="['/animations/collection', slide.id]" [stopLink]="isDragging" class="image">
            <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
            <div class="title">
                <h4>{{slide.name}}</h4>
            </div>
        </a>
    </ng-template>
</owl-carousel-o>

{{slide.name}
{{slide.name}

请格式化您的代码
<owl-carousel-o (dragging)="isDragging = $event.dragging" [options]="customOptions">
    <ng-template carouselSlide *ngIf="slide.product_type == 1 || slide.product_type == 4">
        <a [owlRouterLink]="['/animations', slide.id]" [stopLink]="isDragging" class="image">
            <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
            <div class="title">
                <h4>{{slide.name}}</h4>
            </div>
        </a>
    </ng-template>

    <ng-template carouselSlide *ngIf="slide.product_type == 3">
        <a [owlRouterLink]="['/animations/collection', slide.id]" [stopLink]="isDragging" class="image">
            <img [src]="slide.feature_avatar.xxxdpi" [alt]="" [title]="slide.name">
            <div class="title">
                <h4>{{slide.name}}</h4>
            </div>
        </a>
    </ng-template>
</owl-carousel-o>