let me describe what I am trying to do. I am building a really dynamic ng directive to build table based on data array and config object provided. What I want to know is how to assign attributes dynamically based on an object in scope. Let's say I have an object somewhere in scope like:
$scope.inputs.myInput = {
type : "number",
size : 3,
min : 0,
...
}
and so on and somewhere in my template is
<tr><td>other stuff</td><td><input {{assign the attributes somehow}} /></td></tr>
and the result would be:
<tr><td>other stuff</td><td><input type='number' size='3' min='0' ... /></td></tr>
Is this somehow possible?
What I tried: Currently, I managed to create an input for each item in input array in every row and I can assign a type by type={{type}}
but html attributes can differ for each type of input element and I think it would be nasty to assign attributes to element "hard-coded" way and got stuck here.
Thanks in advance for any feedback!