title: AngularJS ng-model form driven by ng-repeat over UI model description data how to?
body: <p>The JSFiddle <a href="http://jsfiddle.net/vorburger/hyCTA/3/" rel="nofollow">http://jsfiddle.net/vorburger/hyCTA/3/</a> illustrates a (working) "UI modeling" idea I had with AngularJS; note the form is not actually coded out in the HTML template, it's driven by uimodel JSON (which in turn describes how the datamodel is to be rendered/edited):</p>
  
  <pre><code>&lt;div ng-repeat="auimodel in uimodel"&gt;
      &lt;label&gt;{{$index + 1}}. {{auimodel.label}}&lt;/label&gt;
      &lt;input ng-model="datamodel[auimodel.model]" type="{{auimodel.type}}" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Trouble is, as soon as my 'model' isn't a simple property, but a 'path', then my square bracket dynamic keys 'trick' doesn't work anymore of course.. as illustrated by the (broken) <a href="http://jsfiddle.net/vorburger/8CxRC/1/" rel="nofollow">http://jsfiddle.net/vorburger/8CxRC/1/</a> JSFiddle. Any suggestions how one could do this?</p>
  
  <p>PS: Or would something like this necessarily need a complete custom directive rather sooner than later? I’d rather not have to do this, if that’s possible at all, in order to keep creation &amp; maintenance of such UI model “meta templates” as simple as possible...</p>