Skip to content

Commit

Permalink
fix(package): provided config InjectionToken NgxLinkifyjsConfig! #50
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Dec 20, 2018
1 parent b2ea9ec commit 571eb06
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/module/mat-link-preview.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common';
import {ModuleWithProviders, NgModule} from '@angular/core';

import {MatLinkPreviewService} from './service/mat-link-preview.service';
import {NgxLinkifyjsModule, NgxLinkifyjsService} from 'ngx-linkifyjs';
import {DEFAULT_CONFIG, NgxLinkifyjsConfigToken, NgxLinkifyjsModule, NgxLinkifyjsService} from 'ngx-linkifyjs';
import {HttpClientModule} from '@angular/common/http';
import {MatButtonModule, MatCardModule, MatProgressSpinnerModule} from '@angular/material';
import {MatLinkPreviewDirective} from './directives/mat-link-preview.directive';
Expand All @@ -16,6 +16,7 @@ export {MatLinkPreviewContainerComponent} from './components/mat-link-preview-co
export {MatLinkPreviewDirective} from './directives/mat-link-preview.directive';
export {MatLinkPreviewService} from './service/mat-link-preview.service';


@NgModule({
imports: [
CommonModule,
Expand All @@ -32,7 +33,13 @@ export class MatLinkPreviewModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: MatLinkPreviewModule,
providers: [MatLinkPreviewService, NgxLinkifyjsService]
providers: [
MatLinkPreviewService,
NgxLinkifyjsService,
{
provide: NgxLinkifyjsConfigToken,
useValue: DEFAULT_CONFIG
}]
};
}
}

0 comments on commit 571eb06

Please sign in to comment.