首页 文章

无法在Angular2 App中导入'Multiselect-Dropdown'包

提问于
浏览
1

我在Angular2应用程序中使用multiselect-dropdown并导入包如:

import {MultiselectDropdown, IMultiSelectOption} from './multiselect-dropdown';
@Component({
directives: [MultiselectDropdown]
});

但在运行应用程序时,我收到了错误:

SyntaxError:意外的令牌:位于Zone.run(http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:242:44)的ZoneDelegate.invoke(http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:349:29http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:597:58评估http://localhost:3000/app/multiselect-dropdown.tshttp://localhost:3000/app/boot.tsZoneDelegate.invoke @ angular2-polyfills.js加载http://localhost:3000/app/multiselect-dropdown.ts http://localhost:3000/app/multiselect-dropdown.ts错误:349Zone.run @ angular2-polyfills.js:242(匿名函数)@ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452 content_script . js:2 http://localhost:3000/app/boot.ts

我正在使用的套餐是:https://github.com/softsimon/angular-2-dropdown-multiselect

1 回答

  • 0

    更改您的import语句如下:

    import {MultiselectDropdown, IMultiSelectOption} from 'multiselect-dropdown';
    

相关问题