Angular ng-bootstrap轮播无法正常工作?

时间:2018-03-30 16:29:34

标签: javascript angular twitter-bootstrap ng-bootstrap

我正在尝试在我的Angular项目中实现ngbd-carousel-basic。我现在只想把它放在home.component中。但是,这是我在尝试遵循文档中的代码后得到的结果(虽然将文件从html / ts编辑为.component.html和.component.ts)

enter image description here

所以,我是一个Angular noob。所以也许我忘了包括一步?以下是我到目前为止采取的步骤:

  1. app.module.ts 内:从我的文件路径导入NgbdCarouselBasic。宣布它为声明。导入NgbModule,并在var result = agentRecords.Cast<ExpandoObject>().Where(x => x.Any(y => y.Value.ToString().Contains("FL"))); @NgModule
  2. import NgbModule.forRoot()
    1. home.component.html
    2. import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
      
      // Own components
      import {NgbdCarouselBasic} from './shared/carousel/carousel-basic.component';
      
      @NgModule({
        declarations: [
          AppComponent,
          HomeComponent,
          ViewAllRecordsComponent,
          NgbdCarouselBasic
        ],
        imports: [
          BrowserModule,
          AppRoutingModule,
          FormsModule,
          HttpClientModule,
          TableModule,
          NgbModule.forRoot()
        ],
        providers: [
          TimeService
        ],
        bootstrap: [AppComponent]
      })
      export class AppModule { }
      

      这是我的依赖项。也许某些事情是不相容的,我没有意识到?

      <ngbd-carousel-basic></ngbd-carousel-basic>
      

1 个答案:

答案 0 :(得分:0)

需要通过添加以下行在style.css文件中添加引导CSS:    @import "~bootstrap/dist/css/bootstrap.css";

相关问题