When i try to use BsModalService in my component, i get this error
/node_modules/ngx-bootstrap/modal.js 404 (Not Found)
portion of systemjs.config is:
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
map: {
'moment': 'npm:/moment',
'ngx-bootstrap': 'npm:ngx-bootstrap'
},
packages: {
'ngx-bootstrap': {
format: 'cjs',
main: 'bundles/ngx-bootstrap.umd.js',
defaultExtension: 'js'
},
'moment': {
main: 'moment.js',
defaultExtension: 'js'
},
}
and app.module
import { CollapseModule } from 'ngx-bootstrap';
import { ModalModule } from 'ngx-bootstrap';
imports: [
CollapseModule.forRoot(),
ModalModule.forRoot()
],
and in the component
import { BsModalService } from "ngx-bootstrap/modal";
constructor(private modalService: BsModalService) { }
Any Help.
replace with import { BsModalService } from "ngx-bootstrap";
@valorkin
when i do this, this error appears: /node_modules/ngx-bootstrap/index"' has no exported member 'BsModalService'.
Are you using v1.8.1?
Sorry 1.8.0?
Yes im using 1.8.0
snippet from package.json:
"dependencies": {
"ngx-bootstrap": "^1.8.0"
}
This is so wrong, because it is exported
no it is not, check index.ts in the ngx-bootstrap/src/ folder in the repository, you won't find it !
Yes, you are right. Seems I was looking in wrong file, sorry.
https://github.com/valor-software/ngx-bootstrap/blob/development/src/index.ts
Fix will be released tomorrow
Thanks for you.
I'm using "ngx-bootstrap": "^2.0.3", and got this error.
GET http://localhost:64652/node_modules/ngx-bootstrap/modal.js 404 (Not Found)
System Config
Map:
'moment': 'npm:/moment',
"ngx-bootstrap": "node_modules/ngx-bootstrap",
Packages:
'ngx-bootstrap': { format: 'cjs', main: 'bundles/ngx-bootstrap.umd.js', defaultExtension: 'js' },
'moment': {
main: 'moment.js',
defaultExtension: 'js'
},
app.module.ts
import { ModalModule } from 'ngx-bootstrap';
@NgModule
imports: [...,..,.. ModalModule.forRoot()]
This happens when inject the modalService in constructor.
constructor(private lookupService: LookupService
, private modalService: BsModalService) {
Am I doing anything wrong?
Most helpful comment
Fix will be released tomorrow