html

How to style a sibling component in Angular2?  #angularjs #reactjs

  • I like to style logo and searchbar differently on the results page so I tried to select the logo with :host >>> logo and the /deep/ alternative from the result-list component.
  • Http://plnkr.co/edit/Q0CLjcsftbqe0kHKrKks?p=preview I would like to style from resultlist the logo and the searchbar to be black.
  • I have a search component containing a logo, a searchbar and a routeroutlet.
  • The style needs to be added to the logo and the searchbar component.
  • Stack Overflow works best with JavaScript enabled

I have a search component containing a logo, a searchbar and a routeroutlet. The execution of a search navigates to the resultlist, which is the pseudo html outlined here:

@ng_real_ninja: How to style a sibling component in Angular2? #angularjs #reactjs

I have a search component containing a logo, a searchbar and a routeroutlet. The execution of a search navigates to the resultlist, which is the pseudo html outlined here:

component. That doesn’t work. Is there a way to select siblings?

to be black.

I read that post, that is from the parent and not from a sibling. – Matthias Baumgart 3 hours ago

The obvious naive solution would be to hold the state at the respective shared parent component, and set it based on the current router-outlet.

html

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.