Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Swiper正在忽略ng内容_Angular_Swiper_Ngx Swiper Wrapper - Fatal编程技术网

Angular Swiper正在忽略ng内容

Angular Swiper正在忽略ng内容,angular,swiper,ngx-swiper-wrapper,Angular,Swiper,Ngx Swiper Wrapper,我正在尝试在Angular 10中从ngx swiper包装器迁移到swiper。我的方法是尽可能采用模块化解决方案。因此,我想要一个swiper-wrapper.component和swiper-slide.component 由于这一点,我可以将不同的组件传递到swiper中,如果我将来需要修改swiper幻灯片的行为,我只需要在1个位置执行此操作 这种方法在ngx swiper包装中非常有效,但是swiper忽略了ng内容,我可以渲染任何内容:-( 下面是我当前解决方案的一个例子 Root

我正在尝试在Angular 10中从
ngx swiper包装器
迁移到
swiper
。我的方法是尽可能采用模块化解决方案。因此,我想要一个swiper-wrapper.component和swiper-slide.component

由于这一点,我可以将不同的组件传递到swiper中,如果我将来需要修改swiper幻灯片的行为,我只需要在1个位置执行此操作

这种方法在
ngx swiper包装中非常有效
,但是
swiper
忽略了
ng内容
,我可以渲染任何内容:-(

下面是我当前解决方案的一个例子

Root.component.html


{{slide.firstName+''+slide.lastName}
旋转木马


*swiper-slide.com组件

<ng-template swiperSlide>
  <ng-content></ng-content>
</ng-template>

知道我是做错了什么还是swiper有漏洞吗? 有人知道我怎样才能实现我的目标吗

<swiper #swip [config]="virtualConfig" [virtual]="true">
  <!-- This doesnt' work :-(  -->
  <ng-content></ng-content>

  <!-- Uncomment this to make it work -->
  <!-- <ng-container *ngFor="let slide of virtualSlides.slides">
    <ng-template swiperSlide>
      <div>
        {{ slide.firstName + '&nbsp;' + slide.lastName }}
      </div>
    </ng-template>
  </ng-container> -->
</swiper>
<ng-template swiperSlide>
  <ng-content></ng-content>
</ng-template>