I have an Angular component that accepts it's content via Content Projection (). Different components can project different HTML into it. For e.g. suppose the component shows a Toast message, like
<my-toast>Some HTML Here</my-toast>
Some components using it may project warnings (HTML). Others may project errors (again HTML). So far so good.
In my codebase there is a bunch of components using this, which project the exact same HTML content. For e.g.
Component 1: <my-toast> <div style="font-size":large><b>Warning message</b></div></my-toast>
Component 2: <my-toast> <div style="font-size":large><b>Warning message</b></div></my-toast>
Component 3: <my-toast> <div style="font-size":large><b>Warning message</b></div></my-toast>
Is there a way in Angular to encapsulate this HTML at a common place rather than repeating it verbatim in each component that uses ? I dont want to create a component for this, but open to something like TemplateRefs
<div style="font-size":large><b>Warning message</b></div>