Skip to content

Instantly share code, notes, and snippets.

@buildmotion
Created February 1, 2018 06:52
Show Gist options
  • Save buildmotion/fcec1f9713ee7af43b699e73397062eb to your computer and use it in GitHub Desktop.
Save buildmotion/fcec1f9713ee7af43b699e73397062eb to your computer and use it in GitHub Desktop.
MarkdownEditorModule.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { EditorComponent } from './editor/editor.component';
import { MarkdownEditorOptions } from './markdownEditorOptions';
@NgModule({
imports: [
CommonModule
],
declarations: [EditorComponent],
exports: [
EditorComponent
]
})
export class MarkdownEditorModule {
/**
* A static method to provide configuration to the [MarkdownEditorModule].
*/
static forRoot(config: MarkdownEditorOptions) {
return {
ngModule: MarkdownEditorModule,
providers: [{provide: MarkdownEditorOptions, useValue: config}]
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment