After installing module ngx-modialog using the Angular 5 CLI like this:
npm install --save ngx-modialog
I then added it to my app.module.ts
:
import { VexModalModule } from "ngx-modialog/plugins/vex";
import { ModalModule } from "ngx-modialog";
@NgModule({
imports: [
// other module imports
BrowserModule, ReactiveFormsModule, FormsModule, HttpModule, RouterModule,
ModalModule.forRoot(), VexModalModule
],
...
})
In an attempt to use DialogPreset within a class (modal-context.ts
):
import { DialogPreset } from "ngx-modialog/plugins/vex";
export class ModalContext extends DialogPreset {
constructor() {
super();
this.className = 'plain';
this.isBlocking = false;
}
}
However, when running ng serve
, I encountered this error in my modal-context.ts file:
error TS2307: Cannot find module 'ngx-modialog/plugins/vex'.
I am confused as to why the Angular CLI is not able to locate the ngx-modialog/plugins/vex
module. Upon checking the directory structure:
> ls node_modules/ngx-modialog/
bundle package.json plugins src
> ls node_modules/ngx-modialog/plugins
bootstrap js-native vex
> ls node_modules/ngx-modialog/plugins/vex
bundle package.json src