1

I have component with ng-content in it`s template.

@Component({ selector: 'some-cmp', template: `<ng-content></ng-content>` }) export class SomeCmp { } 

So I can use it like that:

<some-cmp></some-cmp> // or <some-cmp> <span>xyz</span> </some-cmp> 

How to correctly check if somebody was passed as content or nothing was passed in the component?

I just need to check if anything is between > and </ of my component selector.

2

1 Answer 1

1

If this is a styling based question, you can look into the :empty CSS selector

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.