I am using Angular 2 and D3.js. I want to show a red rectangle.
It only works if I put styles in the style.css file. Check this plunkr
When
ViewEncapsulation will fix your problem.
ViewEncapsulation
import {Component,ViewEncapsulation} from 'angular2/core' @Component({ selector: 'my-app', encapsulation: ViewEncapsulation.None, providers: [], styles: [` .bar { fill: red; } `], template: ` `, directives: [] })