Javascript ng引导转盘工作不正常?
我正在尝试在我的Angular项目中实现ngbd carousel basic。我现在只想把它放在home.component中。然而,这是我在尝试遵循文档中的代码后得到的结果(尽管将文件从html/ts编辑为.component.html和.component.ts) 所以,我是一个有棱角的傻瓜。也许我忘了包括一个步骤?以下是我迄今为止采取的步骤:Javascript ng引导转盘工作不正常?,javascript,angular,twitter-bootstrap,ng-bootstrap,Javascript,Angular,Twitter Bootstrap,Ng Bootstrap,我正在尝试在我的Angular项目中实现ngbd carousel basic。我现在只想把它放在home.component中。然而,这是我在尝试遵循文档中的代码后得到的结果(尽管将文件从html/ts编辑为.component.html和.component.ts) 所以,我是一个有棱角的傻瓜。也许我忘了包括一个步骤?以下是我迄今为止采取的步骤: 在app.module.ts内部:从我的文件路径导入NgbdCarouselBasic。声明它是一种声明。导入NgbModule,并在@NgMo
@NgModule
内,导入NgbModule.forRoot()
需要通过添加以下行在
style.css
文件中添加引导css:
@import“~bootstrap/dist/css/bootstrap.css”代码>您在哪里提供了图像源?试着把你的html代码放到你需要升级到Bootstrap4才能使用的地方。根据您的依赖关系,您现在使用的是Bootstrap 3.3.7。@ConnorsFan啊,是的,ng Bootstrap确实需要Bootstrap 4。然而,我有这个问题:因此我降级了。。。看起来我需要另一种方式来同时拥有导航栏和旋转木马?结果我给出了另一个问题。你试过了吗?结果只是使用ngx引导而不是ng引导,效果很好,因为它同时支持引导3和引导4。我还没有试过你的解决方案,至少我的问题现在解决了@康纳斯范
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>
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.4",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"postcss": "^6.0.21",
"primeng": "^5.2.4",
"rxjs": "^5.5.6",
"tether": "^1.4.3",
"webpack": "^3.11.0",
"zone.js": "^0.8.19"
},