ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

modal.js 404 (Not Found)

Open MostafaAbdlrazek opened this issue 9 years ago • 11 comments

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.

MostafaAbdlrazek avatar Jul 27 '17 12:07 MostafaAbdlrazek

replace with import { BsModalService } from "ngx-bootstrap";

valorkin avatar Jul 27 '17 12:07 valorkin

@valorkin when i do this, this error appears: /node_modules/ngx-bootstrap/index"' has no exported member 'BsModalService'.

MostafaAbdlrazek avatar Jul 27 '17 13:07 MostafaAbdlrazek

Are you using v1.8.1?

valorkin avatar Jul 27 '17 13:07 valorkin

Sorry 1.8.0?

valorkin avatar Jul 27 '17 13:07 valorkin

Yes im using 1.8.0 snippet from package.json: "dependencies": { "ngx-bootstrap": "^1.8.0" }

MostafaAbdlrazek avatar Jul 27 '17 13:07 MostafaAbdlrazek

This is so wrong, because it is exported

valorkin avatar Jul 27 '17 14:07 valorkin

no it is not, check index.ts in the ngx-bootstrap/src/ folder in the repository, you won't find it !

MostafaAbdlrazek avatar Jul 27 '17 16:07 MostafaAbdlrazek

Yes, you are right. Seems I was looking in wrong file, sorry. https://github.com/valor-software/ngx-bootstrap/blob/development/src/index.ts

valorkin avatar Jul 27 '17 17:07 valorkin

Fix will be released tomorrow

valorkin avatar Jul 27 '17 17:07 valorkin

Thanks for you.

MostafaAbdlrazek avatar Jul 27 '17 19:07 MostafaAbdlrazek

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?

RoccoSen avatar Mar 19 '18 03:03 RoccoSen