Warning when building with AOT for NgbModalRef referring to Angular 5.x

Bug description:

When building with AOT, I’m getting a warning, not an error though.

[ERROR]  11%% building modules 14/14 modules 0 activeWarning: 
Can't resolve all parameters for NgbModalRef in 
/home/projects/angular-app/node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-ref.d.ts: 
([object Object], [object Object], [object Object], ?). 
This will become an error in Angular v5.x

The build went through and no problem as for now but I forsee this will be when Angular move to v5.x

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 4.3.6

ng-bootstrap: 1.0.0-beta.3

Bootstrap: 4

3 thoughts on “Warning when building with AOT for NgbModalRef referring to Angular 5.x

  1. Problem still exists. Steps to reproduce:

    1. ng new my-app

    2. npm install @ng-bootstrap/ng-bootstrap

    3. import NgbModule module in main module file: app.module.ts
      import {NgbModule} from ‘@ng-bootstrap/ng-bootstrap’;


    imports: [
    BrowserModule,
    NgbModule.forRoot()
    ],

    1. ng build -prod

    10%% building modules 5/5 modules 0 activeWarning: Can’t resolve all parameters for NgbModalRef in C:/Projects/Internal/small-test/node_modules/@ng-bootstrap/ng-bootstrap/modal
    /modal-ref.d.ts: ([object Object], [object Object], [object Object], ?). This will become an error in Angular v5.x
    Warning: Can’t resolve all parameters for NgbModalRef in C:/Projects/Internal/small-test/node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-ref.d.ts: ([object Object], [object
    Object], [object Object], ?). This will become an error in Angular v5.x

  2. I’m facing this issue as an error on angular 4.4.3 while using the same 1.0.0-beta.5

    I worked around this error by removing the reference to NgbModalRef from the NgModule and using any as shown below.

    modal:any;

    showModal(){
    this.modal = this.modalService.open(content);
    }

    closeModal(){
    this.modal.close();
    }