Angular2 cannot find the name

I want to use a new component called ng2-material-select in my application. Added it to systemjs.config.js

var map = {
 'Ng2Select': '/node_modules/ng2-material-select',
 "angular2-jwt": "/node_modules/angular2-jwt/angular2-jwt"
};

var packages = {
    'Ng2Select': { main: 'index.js', defaultExtension: 'js' },
};

But when I run the application, I encounter the following error:

Download error http://192.168.0.46//002/ng2-material-select as "ng2-material-select" from http://192.168.0.46 opin002/app/module.js

there is also an error in node_modules / ng2-material-select / index.ts, which, I think, can cause loading problems:

cannot find the required name:

const components = require('./ng2-select.bundle.js');

I updated angularjs and typescript, but the problem is still not resolved.

Please help me.

+4
source share
1 answer

, systemjs.config.js .

..

'Ng2Select': '/node_modules/ng2-material-select'

TS , , JS . , .

'Ng2Select': '/node_modules/ng2-material-select/dist/ng2-select.bundle.js'

/ node_modules/ng2-material-select .

( , JS - , TS).

0

Source: https://habr.com/ru/post/1655274/


All Articles