formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.22k stars 405 forks source link

Multiple inputs within a formly template #597

Closed kurokoda closed 8 years ago

kurokoda commented 8 years ago

What would be the best way of implementing a single Formly template which contained multiple input fields, each tied to a different property of the model, e.g. an input field with a related dropdown field beside it?

screen shot 2016-01-07 at 6 59 43 pm

I've tried:

<div class="grid-form grid-row dual-input">
  <input ng-model="model[{{options.data.inputModel}}]" type="text" name="foo">
  <select
    name="units"
    ng-model="model[{{options.data.dropdownModel}}]"
    ng-options="option.id as option.display for option in options.data.options">
    <option value="" selected>units</option>
  </select>
</div>

But of course, the dot syntax in the brackets breaks.

benoror commented 8 years ago

Do you mind creating an example of what you're trying to accomplish? Please follow the instructions here: http://help.angular-formly.com

This will make it easier for you to get help. Because the github issues are reserved for bug reports and feature requests, I'm going to go ahead and close this issue. See you on chat! Thanks!

abodacs commented 8 years ago

@kurokoda has you get a solution?