Questions tagged [ng-content]

91 questions
193
votes
6 answers

Multiple ng-content

I am trying to build a custom component using multiple ng-content in Angular 6, but this is not working and I have no idea why. This is my component code:
Lucas Santos
  • 2,991
  • 3
  • 19
  • 29
7
votes
1 answer

Angular wrapping angular material tabs component with in custom components

What I am trying to achieve here is I wanna wrap the angular material tabs component with in my shared components. So, here is the component that I'm trying to wrap: PS: I can display component in each tab:
Un1xCr3w
  • 123
  • 5
  • 18
7
votes
2 answers

Iterate over ng-content items and wrap each in it's own nested div

I've read this isn't supported yet, but I was wondering if anyone has figured out a hacky workaround for this issue. What I currently have is a parent component that has this template:
Scott
  • 697
  • 8
  • 18
4
votes
0 answers

ng-content passed into MatAutoComplete does not display options passed in

I am trying to create a component which will pass in mat-option's to mat-autocomplete but the passed in options do not appear. My component: