I'm working on angular2 "2.0.0-rc.1" But zoneJS is giving following error
Error: Uncaught (in promise): Expected 'styles' to be an array of strings.
at resolvePromise (zone.js:538)
at zone.js:515
at ZoneDelegate.invoke (zone.js:323)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (eval at <anonymous> (vendor.js:335), <anonymous>:45:41)
at ZoneDelegate.invoke (zone.js:322)
at Zone.run (zone.js:216)
at zone.js:571
at ZoneDelegate.invokeTask (zone.js:356)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (eval at <anonymous> (vendor.js:335), <anonymous>:36:41)
at ZoneDelegate.invokeTask (zone.js:355)
My code is as follows
let styles = require('./dashboard.css');
let template = require('./dashboard.html');
declare var zingchart:any;
@Component({
selector: 'dashboard',
directives: [ RouterLink, CORE_DIRECTIVES, FORM_DIRECTIVES ],
template: template,
styles: [ styles ]
})
Try this: let styles = String(require('./dashboard.css'));
It work for me. Since styles required a string[], parse styles to String().