Am trying to integrate an angular2 directive into my project; ng2-select from here, but am struggling to integrate it.
In my index.html file, i config Systemjs like this
System.config({
map: {
'ng2-select': 'node_modules/ng2-select'
},
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'ng2-select': {
defaultExtension: 'js'
}
}
});
System.import('app/main').
then(null, console.error.bind(console));
Importing in my component like this
import {Select} from 'ng2-select/ng2-select';
@Component({
selector: 'movie',
templateUrl: 'templates/movie.html',
directives: [Select, FORM_DIRECTIVES, NgClass]
})
exports class MovieComponent {}
Running it and i get this error
angular2-polyfills.js:332 Error: SyntaxError: Unexpected token <(…)ZoneDelegate.invoke @ angular2-polyfills.js:332Zone.run @ angular2-polyfills.js:227(anonymous function) @ angular2-polyfills.js:576ZoneDelegate.invokeTask @ angular2-polyfills.js:365Zone.runTask @ angular2-polyfills.js:263drainMicroTaskQueue @ angular2-polyfills.js:482$ @ system-polyfills.src.js:1340H @ system-polyfills.src.js:1340R.when @ system-polyfills.src.js:1340T.run @ system-polyfills.src.js:1340t._drain @ system-polyfills.src.js:1340drain @ system-polyfills.src.js:1340e @ system-polyfills.src.js:1340
Looking the network inspector, it shows that the js file for the module is loaded, so i dont know why i keep get this error.