Skip to content

Commit

Permalink
return provider array
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Nov 20, 2023
1 parent 154ed80 commit d2c754a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
12 changes: 4 additions & 8 deletions projects/ngx-markdoc/src/lib/provide-markdoc-options.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
EnvironmentProviders,
InjectionToken,
makeEnvironmentProviders,
} from '@angular/core';
import { InjectionToken, Provider } from '@angular/core';
import { Config } from '@markdoc/markdoc';
import { figure, heading, image } from './extensions';

Expand All @@ -19,11 +15,11 @@ const defaultConfig: Config = {

export function provideMarkdocOptions(
markdocOptions?: MarkdocOptions,
): EnvironmentProviders {
return makeEnvironmentProviders([
): Provider[] {
return [
{
provide: MARKDOC_CONFIG,
useValue: markdocOptions?.config ?? defaultConfig,
},
]);
];
}
1 change: 0 additions & 1 deletion src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
image,
provideMarkdocOptions,
} from '@notiz/ngx-markdoc';
import { Config, Node, Tag } from '@markdoc/markdoc';
import { markdocExample } from './markdoc-example';

export const appConfig: ApplicationConfig = {
Expand Down

0 comments on commit d2c754a

Please sign in to comment.