I'm using Angular 2 with SystemJS and trying to add a stylesheet to a component.
Since I'm using SystemJS I can't use relative path as of now, so I used absolute path for the component's template url and also the style url.
However inline style works fine (i.e styles: ['h1 {font-size: 12px; }']
)
The component looks something like this:
@Component({
selector: 'dashboard',
templateUrl: '/app/components/dashboard/dashboard.html',
styleUrls: ['/app/components/dashboard/dashboard.css']
})
The stylesheet dashboard.css
never gets loaded(nor does it returns any error).
Versions of the tools:
~ angular 2: 2.0.0-beta.6
~ systemjs: 0.19.20
~ typescript: 1.8.0
styleUrls
attribute. See these links for mroe details: * #35189303 * github.com/angular/angular/issues/6905 – HeterozygotestyleUrls
doesn't allow absolute url. And I can't use relative path with SystemJS as of now. However I updated angular2 to beta-12 and it behaved like the same way as the previous one. – Commons