Set angularjs input directive name as a variable
问题 I'm trying to set an input like <form name="myForm"> <input name="{{ name }}"/> </form> It works in the dom. I see <input name="whatever_name_is_set_to"/> However in my ngForm I have $scope.myForm: { {{ name }}: { } } Doh' Why am I doing this? I'm trying to create a directive so that I can build my forms programmatically. Then I can do something like <div my-field name="credits" field="course.credits" field-options="courseOptions.credits" title="Credits" ></div> Plunker 回答1: Updated 2017-03