AnthonyNahas / ngx-linkifyjs

Angular V8 wrapper for linkifyjs - library for finding links in plain text and converting them to HTML <a> tags via linkifyjs
https://anthonynahas.github.io/ngx-linkifyjs
MIT License
42 stars 20 forks source link

Lazy load linkify service #138

Open gogoout opened 4 years ago

gogoout commented 4 years ago

Hi there, Just changed NgxLinkifyjsService using the new syntax providedIn:root. So that the module can be lazyloaded with below config.

import { NgxLinkifyjsConfigToken } from 'ngx-linkifyjs';
@NgModule({
  declarations: [AppComponent, ...],
  imports: [...],
  providers:[
    {
      provide: NgxLinkifyjsConfigToken,
      useValue: {enableHash: true, enableMention: true}
    },
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

The only thing worth mention is that the test failed because of this error

TypeError: hashtag_1.default is not a function

This should be some kind of typescript error because the test project is working fine.

gogoout commented 4 years ago

@AnthonyNahas Please let me know if there is anything you need me to change.