0
<input name="options[{{$index}}]"  ng-repeat="n in [] | range:count"
       ng-model="field.options[$index].value" >

in the conttroller

$scope.field.options = [];

when i add item to array it s saving them with key.

"options":{"0":{"value":"sdfas"},"1":{"value":"sdfsdf"},"2":{"value":"sdfasdf"}}

I wanna remove that "0" "1" ..

the reason i wanna remove the key is i think my api not work because of this keys. When i post my objcet like:

List<someobject> options;

and someobject class has only value field.

9
  • How do you add them to the array? Commented Jul 25, 2018 at 16:04
  • @Jimenemex I thought like ng-modal adding it ? when i put this {{$scope.fieldModalVM.field.options}} to view it s showing what it inside Commented Jul 25, 2018 at 16:11
  • Include how you add it with the modal and what {{ $scope.fieldModalVm.field.options }} spits out Commented Jul 25, 2018 at 16:15
  • Only reason why I'm asking is because it looks like you are pushing into the array an object that has a value variable instead of pushing the actual value of the value variable itself into the array. Commented Jul 25, 2018 at 16:32
  • field.options is just empty array. when i write something inside that input could it be store in ooptions array? that s what i m trying to do. Commented Jul 25, 2018 at 17:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.