Angular 将角度材质旋转滑块与图像一起使用时出现问题
我正在尝试用角度图像构建旋转木马。Angular 将角度材质旋转滑块与图像一起使用时出现问题,angular,typescript,angular-material-7,Angular,Typescript,Angular Material 7,我正在尝试用角度图像构建旋转木马。 我是根据这个链接做的:。 但它不起作用。 问题是它只显示第一个图像。 代码如下: home.component.html <mat-carousel timings="250ms ease-in" [autoplay]="true" interval="5000" color="accent"
我是根据这个链接做的:。
但它不起作用。
问题是它只显示第一个图像。
代码如下: home.component.html
<mat-carousel
timings="250ms ease-in"
[autoplay]="true"
interval="5000"
color="accent"
maxWidth="auto"
proportion="25"
slides="5"
[loop]="true"
[hideArrows]="false"
[hideIndicators]="false"
[useKeyboard]="true"
[useMouseWheel]="false"
orientation="ltr">
<mat-carousel-slide
#matCarouselSlide
*ngFor="let slide of slides; let i = index"
[image]="slide.image"
overlayColor="#00000040"
[hideOverlay]="false">
</mat-carousel-slide>
</mat-carousel>
你能帮我找出错误吗?非常感谢你 签出我使用上述细节创建的这个工作小提琴,它就工作了
检查我使用上述细节创建的这把工作小提琴,它就可以工作了
动画是发生还是卡在第一张幻灯片上?是的,动画发生了,但我看到的不是图像背景的颜色,而是您的控制台没有错误?是的,没有错误动画发生还是卡在第一张幻灯片上?是的,动画发生了,但是,我看到的不是图像,而是背景的颜色。您的控制台没有错误吗?是的,没有错误。您是否更改了代码中的某些内容?我没找到。不,米奇,密码是一样的。我只是在安装了物料转盘软件包后安装了Dececies,并导入到模块
npm I@ngmodule/material carousel
MatCarouselModule.forRoot()
中,您也可以从此调用[您是否更改了代码中的某些内容?我没有找到它。没有,Mickey,它只是相同的代码。我只是安装了Dececies,在安装了物料转盘包并导入模块npm I@ngmodule/material carousel
MatCarouselModule.forRoot()
后为我工作,您也可以从这里调用[
slides = [
{'image': 'https://image.freepik.com/free-photo/chalk-board-sketch-with-loudspeaker-phrase-we-need-volunteers_78790-1167.jpg'},
{'image': 'https://image.freepik.com/free-photo/together-we-can-help-concept_23-2148733265.jpg'},
{'image': 'https://image.freepik.com/free-photo/people-old-woman-young-hand-care-holding-healthcare-disabled-walking-with-assistance_36325-2363.jpg'},
{'image': 'https://image.freepik.com/free-photo/pupils-reading-book-classroom_1150-3859.jpg'},
{'image': 'https://image.freepik.com/free-photo/group-multiethnic-diverse-hands-raised_53876-64967.jpg'}];