1
votes

I'm using multiselect-dropdown in Angular2 app and importing the package like:

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

But on running the app, I got the error:

SyntaxError: Unexpected token : at ZoneDelegate.invoke (http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:349:29) at Zone.run (http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:242:44) at http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:597:58 Evaluating http://localhost:3000/app/multiselect-dropdown.ts Error loading http://localhost:3000/app/multiselect-dropdown.ts as "./multiselect-dropdown" from http://localhost:3000/app/boot.tsZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ 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

Package I'm using is : https://github.com/softsimon/angular-2-dropdown-multiselect

1

1 Answers

0
votes

Change your import statement as below :

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