Angular-Cli로 만든 각도 2 앱에 2 개의 모듈이 있습니다. (버전 1.0.0-beta.28.3) 패키지는 'npm install ng2-bootstrap @ latest bootstrap @ latest --save'(무언가를 놓친 것이 확실하지 않음)로 설치됩니다. ng2-bootstrap 및 bootstrap 패키지는 최신 버전입니다. app.module.ts에서 ng2-directive를 가져 오면 모든 것이 잘 작동합니다. 그러나 중첩 된 모듈에서 사용하려고하면 아무 것도 나타나지 않습니다. ng2-bootstrap 모듈 문제
분명히 말 :import { InModule } from './in.module';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AccordionModule } from 'ng2-bootstrap';
import { AppComponent } from './app.component';
import { CompComponent } from './comp/comp.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
InModule,
HttpModule,
AccordionModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
내가 appcomponent에 아코디언을 사용할 수 있습니다. 내가 CompComponent에 다음으로 사용하려고 할 때 그러나 :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AlertModule } from 'ng2-bootstrap';
import { CompComponent } from './comp/comp.component';
@NgModule({
declarations: [
CompComponent
],
imports: [
BrowserModule,
FormsModule,
AlertModule.forRoot() // or just AlertModule
],
providers: [],
bootstrap: []
})
export class InModule { }
나는 흰색 화면을 얻었다.
나는 그것이 문제인지 실수인지 확실하지 않습니다.
오류가 있습니까? – zmanc
아니요, 모든 것이 콘솔에서 정상입니다. – user3119043
라우팅 기능이 있습니까? 라우팅에서 추적을 사용하고 라우팅 문제가 있는지 확인하십시오. – zmanc