2017-10-20 12 views
1

link에서 ng2 스마트 테이블을 배우려고하는데이 오류가 발생했습니다.'AppModule'모듈에 의해 'Ng2SmartTableModule'모듈이 선언되었습니다.

잡히지 않은 오류 : 'AppModule'모듈에서 예기치 않은 모듈 'Ng2SmartTableModule'이 (가) 선언되었습니다. @ Pipe/@ Directive/@ Component 주석을 추가하십시오. 여기

사람이 저를 해결하는 데 도움이 할 수있는 app.component.ts

import { Component } from '@angular/core'; 
 

 
@Component({ 
 
    selector: 'app-root', 
 
    //templateUrl: './app.component.html', 
 
    styleUrls: ['./app.component.css'], 
 
    //template: `<ng2-smart-table [settings]="settings"></ng2-smart-table>` 
 
}) 
 
export class AppComponent { 
 
    //title = 'app'; 
 
    settings = { 
 
    columns: { 
 
     id: { 
 
     title: 'ID' 
 
     }, 
 
     name: { 
 
     title: 'Full Name' 
 
     }, 
 
     username: { 
 
     title: 'User Name' 
 
     }, 
 
     email: { 
 
     title: 'Email' 
 
     } 
 
    } 
 
    }; 
 
}

그리고 app.module.ts

import { BrowserModule } from '@angular/platform-browser'; 
 
import { NgModule } from '@angular/core'; 
 
import { Ng2SmartTableModule } from 'ng2-smart-table'; 
 

 
import { AppComponent } from './app.component'; 
 

 
@NgModule({ 
 
    declarations: [ 
 
    AppComponent, 
 
    Ng2SmartTableModule 
 
    ], 
 
    imports: [ 
 
    BrowserModule 
 
    ], 
 
    providers: [], 
 
    bootstrap: [AppComponent] 
 
}) 
 
export class AppModule { }
입니다 티 s의 오류?

미리 감사드립니다. 이 모듈이기 때문에

답변

2

는, 당신은 답을 declarations

import { AppComponent } from './app.component'; 

@NgModule({ 
    declarations: [ 
    AppComponent 

    ], 
    imports: [ 
    BrowserModule, 
    Ng2SmartTableModule 
    ], 
    providers: [], 
    bootstrap: [AppComponent] 
}) 
export class AppModule { } 
+0

감사에서 imports되지 내부에 추가해야합니다 :) –