1

I'm currently implementing the quill editor with quill-mention in an angular project. Quill-mention should use a specific http request from an implemented employee-service:

QuillModule.forRoot({
    modules: {
        mention: {
                allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
                mentionDenotationChars: ["@"],
                source: employeeService.getEmployees()
            }
        }
})

The problem is how to inject this Service function into the QuillModule config. I allready tried to create a QuillConfigModule:

@NgModule({
    imports: [
        QuillModule.forRoot()
    ]
})
export class QuillConfigModule {
    static QUILL_CONFIG = {};

    public static forRoot(config: QuillConfig): ModuleWithProviders<QuillConfigModule> {
        return {
            ngModule: QuillConfigModule,
            providers: [
                QuillService,
                {provide: QUILL_CONFIG_TOKEN, useFactory: QuillConfigModule.GET_QUILL_CONFIG},
                { provide: "config", useValue: config }
            ]
        };
    }
}

The config even seems to get updated, but the Quill Editor is still the unconfigured one.

dithomas01
  • 11
  • 1

0 Answers0