繁体   English   中英

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

[英]Unable to Import 'Multiselect-Dropdown' Package in Angular2 App

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

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

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

SyntaxError:意外的令牌:位于Zone.run的ZoneDelegate.invoke( http:// localhost:3000 / node_modules / angular2 / bundles / angular2-polyfills.js:349:29 )( http:// localhost:3000 / node_modules / angular2) /bundles/angular2-polyfills.js:242:44 )在http:// 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为“./multiselect-dropdown”时出错: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

更改您的import语句如下:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM