我很想将 BsModalService 导入到我的组件中。但它会抛出 404,如下所示。
我BsModalService
在我的组件中导入为
import { BsModalService } from 'ngx-bootstrap/modal';
GET http://localhost:8000/node_modules/ngx-bootstrap/modal.js 404 (Not Found)
(index):21 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:8000/node_modules/ngx-bootstrap/modal.js
export class MyComponent implements OnInit {
...
constructor(private bsModalService: BsModalService) {}
}
包.json
"ngx-bootstrap": "^1.8.0",
systemjs.config.js
map: {
...
'ngx-bootstrap': 'node_modules/ngx-bootstrap'
}
packages: {
..
'ngx-bootstrap': { format: 'cjs', main: 'bundles/ngx-bootstrap.umd.js', defaultExtension: 'js' },
}
app.module.ts
import { ModalModule } from 'ngx-bootstrap';
我在这里想念什么。