Angular scratching – Tips to fix display flex errors when creating components

Tram Ho

While working with Angular, I encountered a small error, I created a component list that includes many component cards , with my component list to display: flex for easy layout. However , I faced the problem that when I put the component cards into the list and called up, the component card was displayed: new blocks .

Haiz! No problem, thanks to the ability to search for the gods to discover keyword: host in angular (link refer here ). As it says, we can use this keyword to style the selector component again .

That’s fine then, turn on the Developer tool (F12 on that Chorme) . Let’s inspect the component card, see how it looks like the problem is with the css display itself.

Ok, now try adjusting the dislplay in element {}, try the display: contents, it’s ok.

Then now just go to the component card, edit the css as follows:


Share the news now

Source : Viblo