Reputation: 114
In a template I would like to do something like:
<my-{{data.type}}></my-{{data.type}}>
but it doesn't replace the {{data.type}}
markup.
Is there a solution or a workaround for this?
Upvotes: 1
Views: 50
Reputation: 5237
You can't do that but you can use ng-switch like,
<div ng-switch="data.type">
<div ng-switch-when="test1">
<my-test1></my-test1>
</div>
<div ng-switch-when="test2">
<my-test2></my-test2>
</div>
</div>
Upvotes: 1