1

I'm trying to add ng2-ckeditor to test project. For this i added following line to systemjs.config.js

        '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 { }

But receive an error.

ORIGINAL EXCEPTION: CKEDITOR is not defined

All code

unsafePtr
  • 1,591
  • 2
  • 17
  • 27

1 Answers1

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]
})
micronyks
  • 54,797
  • 15
  • 112
  • 146