JulioWar / jw-bootstrap-switch-ng2

Bootstrap Switch for Angular 2+
https://juliowar.github.io/jw-bootstrap-switch-ng2/
MIT License
43 stars 14 forks source link

'bSwitch' is not a known element #13

Closed sabb123 closed 6 years ago

sabb123 commented 6 years ago

We are using angular4.

Package.json is like below "jw-bootstrap-switch-ng2": "^1.0.4",

systemjs 'jw-bootstrap-switch-ng2': 'lib/jw-bootstrap-switch-ng2' 'jw-bootstrap-switch-ng2': { main: './dist/index.js', defaultExtension: 'js' }

app.module.ts import { JWBootstrapSwitchModule } from "jw-bootstrap-switch-ng2"; @NgModule({ imports:[JWBootstrapSwitchModule]})

Gulpfile has copied the jw-bootstrap-switch-ng2 folder

Getting the error 'bSwitch' is not a known element:

  1. If 'bSwitch' is an Angular component, then verify that it is part of this module. What am I doing wrong? Are there any dependencies that needs to be brought in?

Thank you

JulioWar commented 6 years ago

Hello @sabb123

Can you check if the configuration of thesystemjs.config.js that is in the readme of this library work for you?

It's something like this:

System.config({
        paths: {
            'npm:': 'node_modules/'
        },
        map: {
            ...,
            'jw-bootstrap-switch-ng2': 'npm:jw-bootstrap-switch-ng2'
        },
        packages: {
            ...,
            'jw-bootstrap-switch-ng2': {
                main: './dist/index.js',
                defaultExtension: 'js'
            }
        }
    });
sabb123 commented 6 years ago

Yes, you are correct. Systemjs.config.js file did not point to the right path. Thank you