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

时间:2016-08-30 07:07:33

标签: angular

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

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

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

SyntaxError:意外的令牌:         在ZoneDelegate.invoke(http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:349:29)         在Zone.run(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.ts     从http://localhost:3000/app/multiselect-dropdown.ts @ angular2-polyfills.js加载http://localhost:3000/app/boot.tsZoneDelegate.invoke为“./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

1 个答案:

答案 0 :(得分:0)

更改您的import语句如下:

vm.dtColumnDefs = [
        DTColumnDefBuilder.newColumnDef(-1).withOption('responsivePriority',1)
    ];