I import a modal library of ng-bootstrap in a lazy module.
@NgModule({imports: [NgbModalModule]})
This library has a NgbModal
service provided in root.
@Injectable({providedIn: 'root'})
class NgbModal {...}
I inject it into a component.
constructor(private modal: NgbModal) {}
I develop a class extension of that one.
export class CustomNgbModal extends NgbModal{...}
How can I override NgbModal type with CustomNgbModal?
Using modules will be
{provide: NgbModal, useClass: CustomNgbModal}
but using providedIn root metadata, no clue.
So, how can I override a module which is provided in root?