in Angular by
What is ng-content Directive?

1 Answer

0 votes

The HTML elements like p (paragraph) or h1 (heading) have some content between the tags. For example, <p>this is a paragraph</p> and <h1>this is a heading</h1>. Now, similar to this, what if we want to have some custom text or content between the angular tags like  <app-tax>some tax-related content</app-tax> This will not work the way it worked for HTML elements.  Now, in such cases, the <ng-content> tag directive is used. 

Related questions

0 votes
asked Jul 5, 2022 in Angular by sharadyadav1986
0 votes
asked Feb 5, 2021 in Angular by SakshiSharma
+1 vote
asked Jan 15, 2020 in Angular by rahuljain1