[[object Object]] in input text angularjs

Christian Hardy picture Christian Hardy · May 10, 2015 · Viewed 18.3k times · Source
<form class="form-horizontal" role="form" name="addCreditoBuscar" id="addCreditoBuscar" ng-controller="AddCreditoAppController">
 <div class="form-group">
  <label class="col-sm-2 col-sm-2 control-label">Buscar</label>
   <div class="col-sm-10">
    <input type="text" class="form-control" name="buscar" ng-model="addCreditoBuscar.buscar" ng-required="true" placeholder="Buscar por cedula, nombre o apellido">
    <span class="help-block" ng-show="addCreditoBuscar.buscar.$error.required">Este campo es requerido es requerido.</span>
   </div>
  </div>
</form>

This is my code for a input text, but the result is this one - http://prntscr.com/73otmc

Answer

ricardoasensio picture ricardoasensio · Mar 26, 2017

The solution is simple. You are using the same "form name" than the object you want to put. Change the "Form name" to one different like name="formAddCreditoBuscar"

<form class="form-horizontal" role="form" name="formAddCreditoBuscar" id="addCreditoBuscar" ng-controller="AddCreditoAppController">

Then your problem would disappear