I am working on angular project. Most of forms are same and my lot of html gets repeated. e.g. save cancel button UI. I have base component which handles init, get, save logic. Child component has form UI and logic only specific to child.
i can create one service/directive/component which has list of all common html and i can plug it in any component i need.
link to stackblitz. https://stackblitz.com/edit/angular-jvqj63
I this sample code I have #okCancel template in child1, child2 and base components. How can I have only one copy of this and use everywhere?
Basically i want to define repetitive html in place be it parent component / directive / service and use them wherever you need.
Comments
Post a Comment