Open daen1on opened 11 months ago
Searching through the web, In Angular 10 and later, the ModuleWithProviders type without a generic has been deprecated. This is because the Angular team wants to make the Ivy compiler the default for Angular applications, and the Ivy compiler requires that ModuleWithProviders be generic. Please update the ngx-linkify.module.ts to this:
import {CommonModule} from '@angular/common'; import {Inject, InjectionToken, ModuleWithProviders, NgModule} from '@angular/core'; import * as linkify from 'linkifyjs'; import hashtag from 'linkifyjs/plugins/hashtag'; import mention from 'linkifyjs/plugins/mention';
import {NgxLinkifyjsService} from './service/ngx-linkifyjs.service'; import {NgxLinkifyjsPipe} from './pipes/ngx-linkifyjs.pipe'; import {NgxLinkifyjsConfig} from './interfaces/ngx-linkifyjs.interface';
export const NgxLinkifyjsConfigToken = new InjectionToken
@NgModule({ imports: [ CommonModule ], exports: [NgxLinkifyjsPipe], declarations: [NgxLinkifyjsPipe] }) export class NgxLinkifyjsModule {
static forRoot(config: NgxLinkifyjsConfig = DEFAULT_CONFIG): ModuleWithProviders
constructor(@Inject(NgxLinkifyjsConfigToken) public config: NgxLinkifyjsConfig) { if (config.enableHash) { hashtag(linkify); }
if (config.enableMention) {
mention(linkify);
}
}
}**
Bug Report or Feature Request (mark with an
x
)OS and Version?
Versions
Angular 16
Repro steps
When trying to execute, angular would say "Usage without a generic type is deprecated"
The log given by the failure
Desired functionality
Mention any other details that might be useful