I have a collection of objects, each with a property indicating its type. Here's an example:
[
{
"type" : "date",
...
},{
"type" : "phone",
...
},{
"type" : "boolean",
...
}
]
I'm looking for a way to display these objects using different templates based on their types in a generic manner. The templates may vary in the DOM structure (e.g., one object might just need a span element, while another requires a checkbox and input text field). How can I achieve this? (I'm using Angular, if that information is helpful)