I have the following JSON:
usuarios:{
{name:pepe, telefonos:{movil:166666666, movil2:66852147}},
{name:paco, telefonos:{movil:66666666, movil2:66852147}}
}
and my index.html
<div ng-controller="TestController">
<div ng-repeat="user in usuarios">
{{user.name}}
<div ng-repeat="phone in user.telefonos">
<input type="text" name="movil1" ng-model="movil1" ng-value="{phone.movil1}}">
<input type="text" name="movil2" ng-model="movil2" ng-value="{phone.movil2}}">
</div>
</div>
<input type="text" name="movil3" ng-model="movil3" ng-value="6555555">
</div>
So far everything is correct, it works, BUT, in my controller if I do this:
console.log($scope.movil1) => sale undefined
however I do this:
console.log($scope.movil3) => sale el valor
It has to do something with the repeat
Any suggestions?
Greetings