Answer the question
In order to leave comments, you need to log in
How correctly in this situation to organize the transfer of information to the object?
Please tell me how to get an object of this type from the form:
info: [
{name: "название поля", value: "результат инпута"},
{name: "название поля", value: "результат инпута"}...]
<label>Name: </label><input type="text" ng-model="info.value"> // в него мы пишем например Мик
<label>Last Name: </label><input type="text" ng-model="info.value"> //а сюда Томсон
info: [
{"name": "Name: ", "value": "Мик"},
{"name": "Last Name", "value": "Томсон"}... и так далее..]
Answer the question
In order to leave comments, you need to log in
Create your directive with require: 'ngModel' and add your parser that can convert and pass values from your inputs anywhere.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question