I attempted to create a tabs component that could be used similarly to Angular Material Component. However, the solution I came up with was flawed and buggy.
In this attempt, I utilized
document.getElementsByTagName('app-tab')
.
This is the template for the tabs component.
https://i.sstatic.net/SsmYY.jpg
Here is an example of how it was implemented.
https://i.sstatic.net/aC2tw.jpg
I was trying to access the label attribute value of app-tab
, but I am unsure how to do so from app-tabs, which uses ng-content
.
The Solution
This concept is known as content projection.
You can find a detailed explanation here: