Body
Body

Reputation: 3688

Directive specific styles in Angular 2

I have some directives in my application which are loaded only in certain components. Currently all the styles related to these directives are globally defined in style.css.

Instead of adding these styles globally, is there a way I can hook separate style URLs for directive just like how we do in components.

e.g

@Directive ({
    selector: '[foobar]',
    styleUrls: [
       'foobar.directive.css'
    ]
})

Upvotes: 4

Views: 7773

Answers (1)

Related Questions