2016-10-05 5 views
1

Я пытаюсь добавить ng2-ckeditor для тестирования проекта. Для этого я добавил следующую строку systemjs.config.jsНельзя использовать ng2-ckeditor между компонентами. SharedModule

 'ng2-ckeditor': 'npm:ng2-ckeditor/lib/CKEditor.js' 

shared.module.ts

import { NgModule }   from "@angular/core"; 
import { CommonModule }  from "@angular/common"; 
import { FormsModule }   from "@angular/forms"; 
import { CKEditorModule }  from "ng2-ckeditor"; 

@NgModule({ 
imports: [ 
    CommonModule, 
    FormsModule, 
    CKEditorModule 
], 
exports: [ 
    CommonModule, 
    FormsModule, 
    CKEditorModule 
] 
}) 

app.module.ts

import { NgModule, ChangeDetectorRef }  from "@angular/core"; 
import { BrowserModule } from "@angular/platform-browser"; 
import { AppComponent } from "./app.component"; 
import { TestModule } from "./test/test.module"; 

@NgModule({ 
imports: [BrowserModule, TestModule], 
declarations: [AppComponent], 
bootstrap: [AppComponent] 
}) 
export class AppModule { } 

test.module.ts

import { NgModule }   from "@angular/core"; 
import { CommonModule }  from "@angular/common"; 

import { SharedModule }  from "../share/shared.module"; 
import { TestComponent }  from "./test.component"; 
import { ChildComponent } from "./child/child.component"; 

@NgModule({ 
imports: [SharedModule], 
declarations: [TestComponent, ChildComponent], 
exports: [TestComponent] 
}) 
export class TestModule { } 

Но об ошибке.

ОРИГИНАЛ ИСКЛЮЧЕНИЕ: CKEditor не определен

All code

ответ

1

app.module.ts

@NgModule({ 
imports: [BrowserModule,SharedModule,TestModule], //<<<<<<<-----here 
declarations: [AppComponent], 
bootstrap: [AppComponent] 
}) 
export class AppModule { } 

test.module.ts

@NgModule({ 
imports: [CommonModule],      //<<<<<<<-----here 
declarations: [TestComponent, ChildComponent], 
exports: [TestComponent] 
}) 
+0

исправлено вашим советом. но get get error _Can't не связывается с 'ngModel', так как это не известное свойство 'ckeditor'_ – unsafePtr

+0

app.component содержит в шаблоне. test.component содержит . И уже ребенок спрятал . – unsafePtr

 Смежные вопросы

  • Нет связанных вопросов^_^