in Angular by (31.6k points)
Define the ng-content Directive?

1 Answer

0 votes
by (23.9k points)

Conventional HTML elements have some content between the tags. For instance:

<p>Put your paragraph here</p>

Now consider the following example of having custom text between angular tags:

<app-work>This won’t work like HTML until you use ng-content Directive</app-work>

However, doing so won’t work the way it worked for HTML elements. In order to make it work just like the HTML example mentioned above, we need to use the ng-content Directive. Moreover, it is helpful in building reusable components.

Related questions

0 votes
+1 vote
asked Jan 15, 2020 in Angular by sharadyadav1986 (31.6k points)
0 votes
asked Feb 5, 2021 in Angular by SakshiSharma (32.2k points)
0 votes
0 votes
asked Sep 24 in Angular by AdilsonLima (6.2k points)
0 votes
asked Jul 10 in Angular by Robindeniel (20.8k points)
0 votes
asked Feb 5, 2021 in Angular by SakshiSharma (32.2k points)
...