Stackoverflow Stackoverflow - 1 year ago 67
AngularJS Question

AngularJS: How to create and use an array for a value in the HTML

I have created a custom directive with fields:


<mydir ng-model="myBinding" input-array="input1,input2"></mydir>

Input 1 and input 2 are both data bindings, how can I dynamically create an array of these two and pass then in the

I do not want this logic to be in a controller or the directive.

Answer Source

Just wrap the variables in array braces


Beyond that there isn't nearly enough detail in question

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download