What I understood about the host is that if I have a child component inside the parent component and we want to create a child component from the parent component, we can use: host. and: host-context for the other way around. Please let me know if this is the correct use of the host.
https://angular.io/docs/ts/latest/guide/component-styles.html
When I try to do the same in my application, it works as an assistant professor
Application Component Template
<div class ="top">
<h1>
Home Component
</h1>
<hr>
<app-ngrx></app-ngrx>
<router-outlet></router-outlet>
<div>
ngrx component template
<h3 class="mine">NGRX</h3>
<button (click)="increment()">Increment</button>
<div>Current Count: {{ counter | async }}</div>
<button (click)="decrement()">Decrement</button>
<button (click)="reset()">Reset Counter</button>
CSS Application Component
:host(.mine){
color:red;
}
This does not seem to work. Please help, I can not understand.
I looked at this question, but just could not understand
Angular 2: How is the host element style of a component?
Updated after @Gunter answer
In my app-ngrx template, I added
<h3 class = "mine">NGRX</h3>
<button (click)="increment()">Increment</button>
<div>Current Count: {{ counter | async }}</div>
<button (click)="decrement()">Decrement</button>
<button (click)="reset()">Reset Counter</button>
app-ngrx css
:host(.mine){
color:red;
}
,
<app-ngrx></app-ngrx>
h3 , , , <app-ngrx class = "mine"></app-ngrx>
user7161814