How to apply css in angular 2. I am using webstorm IDE for compilation. Also facing some cache issue, again and again I have to delete browser history, also confused about images path in css, how do i implement relative paths of images in css files and how to add custom styles in css and apply them on some specific element.
2 Answers
By setting styles or styleUrls metadata
@Component({
selector: 'hero-app',
template: `
<h1>Tour of Heroes</h1>
<hero-app-main [hero]=hero></hero-app-main>`,
styles: ['h1 { font-weight: normal; }']
})
OR
@Component({
selector: 'hero-app',
templateUrl: './home.html'
styleUrls: ['./home..css']
})