Search code examples

In Angular2, how to make <app-root> 100% height

I am using Angular2 and I want to set the height of <app-root> to 100% of <body>.

Currently I have:


and in CSS file I've set:

app-root {
  height: 100%;

but it seems nothing changed.

Do you have any idea?


  • In the component css use the :host selector

    :host {
        height: 100%