If I have the following:
I guess either the registration scope is not initialized or registration.first_name is an object.
Have a look at this plunker: http://plnkr.co/edit/bdbs0XVB8hZSodOTYyM4?p=preview
Initialize the registation model either in controller or using ng-init ng-init="registration = {}"
If registration.first_name is an object then this will be displayed as [Object object]
. You have to supply a proper string value as model to the ng-model
Angularjs Form showing [object Object] on load in form fields
I am guessing, it will show this error, only if your form name and ng-model name (value) are same
like
<form name="userform">-------
<input ng-model="userform.firstname">
change your form name or your ng-model value to user or some xyz
Setting the name
attribute on a form creates a scope object which is useful for validation but is not meant to be used for the ng-model
attributes of inputs.
If you use a separate scope variable for ng-model, it will work as you expect:
<form
...
name="reg"
...
>
<input
...
ng-model="registration.first_name"
...
/>
Demo
If you don't register a controller in ng-controller, you can remove name="registration" from form, because controller has init with forms, i try and works.
plnkr.co/edit/JK3utpe1eERrJeoveaCQ?p=preview