import { NgModule, ModuleWithProviders } from '@angular/core'; import { HtmlEditorComponent } from './html-editor.component'; import { defaultModules } from './html-editor-defaults'; import { QUILL_CONFIG_TOKEN, QuillConfig } from './html-editor.interfaces'; @NgModule({ declarations: [HtmlEditorComponent], imports: [], exports: [HtmlEditorComponent], providers: [ { provide: QUILL_CONFIG_TOKEN, useValue: { modules: defaultModules } } ] }) export class FarrisHtmlEditorModule { static forRoot(config?: QuillConfig): ModuleWithProviders { return { ngModule: FarrisHtmlEditorModule, providers: [ { provide: QUILL_CONFIG_TOKEN, // tslint:disable-next-line:only-arrow-functions useValue: config || { modules: defaultModules } } ] }; } }