0

Similar to Dynamically assign ng-model except the solutions provided assign it to the same element. What I would want to do is assign it to elements inside the element.

For example given a form

<form name="myForm" my-directive controller="MyController as me">
  <input name="email">
  <input name="password">
  <button type="submit" ng-click="me.submit()">
</form>

I would like it to transform to

<form name="myForm" my-directive controller="MyController as me">
  <input name="email" ng-model="email">
  <input name="password" ng-model="password">
  <button type="submit" ng-click="me.submit()">
</form>

I was thinking it was the compile with "pre" then do a $compile but I seem to get the side effect of the ng-click being assigned twice.

Community
  • 1
  • 1
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

0 Answers0