angular4-carousel没有显示

时间:2017-05-14 15:40:26

标签: angular carousel

我试图让angular4-carousel与我的angular 4应用程序一起使用 它没有错误,但没有显示

我把它放在我的app.component.html

@IBAction func tapOnView(_ sender: UITapGestureRecognizer) {
    //change main View controller
}

我把它放在我的app.component.ts

<carousel [sources]="imageSources" [config]="config"></carousel>

页面加载但没有轮播。我需要包含一些特定的CSS吗?

1 个答案:

答案 0 :(得分:0)

请检查下面给出的安装步骤

在app.module.ts

import { CarouselModule } from 'angular4-carousel';

在模块导入部分

中添加轮播
imports: [CarouselModule]

在组件文件中;

import { ICarouselConfig, AnimationConfig } from 'angular4-carousel';

并且您的问题配置正常。

另外请检查如果使用CLI,请将css文件导入css部分的angular-cli.json文件;如果没有,您必须将以下代码添加到index.html或在css路径下导入到common style.css文件

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
相关问题