<form data-ng-submit="submitInvoiceForm();" name="myForm" novalidate>
<input type="text" name="myNumber" ng-model="number" value="entered text"/>
<!-- input name will automatically become property of myForm -->
<input type="submit" value="save"/>
</form>
console.log($scope.myForm); // {myNumber: "entered text" }
On Friday, January 17, 2014 6:38:16 AM UTC-7, Pushpendra Kumar wrote:
>
> Hello,
>
> Can we create form json taking html field's name attribute as key.
> <html>
> <form data-ng-submit="submitInvoiceForm();" name="myForm"
> novalidate>
> <input type="text" name="Form.myNumber" ng-model="number" value="entered
> text"/>
> <input type="submit" value="save"/>
> </form>
> json:Form
>
> </html>
>
> Now I want form json as:
> {myNumber:"entered text"}
>
> don't want json as:
> {number:"entered text"}
>
> can we do this using angular best practices?
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.