Skip to content

Commit

Permalink
Relax provideMarkdown method usage to not require environment provider (
Browse files Browse the repository at this point in the history
#490)

* Relax provideMarkdown method usage to not require environment provider
* Fix return typing

---------

Co-authored-by: jfcere <[email protected]>
  • Loading branch information
NateRadebaugh and jfcere authored Nov 19, 2023
1 parent e3475e1 commit cf5a1df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/provide-markdown.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EnvironmentProviders, makeEnvironmentProviders, SecurityContext } from '@angular/core';
import { Provider, SecurityContext } from '@angular/core';
import { MarkdownModuleConfig } from './markdown.module';
import { MarkdownService, SECURITY_CONTEXT } from './markdown.service';
import { MARKED_EXTENSIONS } from './marked-extensions';

export function provideMarkdown(markdownModuleConfig?: MarkdownModuleConfig): EnvironmentProviders {
return makeEnvironmentProviders([
export function provideMarkdown(markdownModuleConfig?: MarkdownModuleConfig): Provider[] {
return [
MarkdownService,
markdownModuleConfig?.loader ?? [],
markdownModuleConfig?.clipboardOptions ?? [],
Expand All @@ -17,5 +17,5 @@ export function provideMarkdown(markdownModuleConfig?: MarkdownModuleConfig): En
provide: SECURITY_CONTEXT,
useValue: markdownModuleConfig?.sanitize ?? SecurityContext.HTML,
},
]);
];
}

0 comments on commit cf5a1df

Please sign in to comment.