0
Hello I am Posting 3rd time my question for checkbox.
Fully code and response on this question which I have posted already.
I have created fiddle of my data. 
I am getting broken data please check my fiddle.

Please test my json may be there is problem. I want to create check box using dietry_reqs data. http://jsfiddle.net/ashishoft/03L3faq5/2/

Please please help me :(

2 Answers 2

0

First: your dietry_reqs is a string not an iterable object:

fixed:

"dietry_reqs": [{"id":1,"name":"delhi","value":false},{"id":2,"name":"mumbai","value":false},{"id":3,"name":"ahmedabad","value":false}],

And the checkboxes:

<li ng-repeat="(key, value) in thing.dietry_reqs">
    <input type="checkbox" ng-model="value.value"> | {{value.name}} => {{value.value}}
</li>

Check it: http://jsfiddle.net/pz2f2k39/

Also: official docs

Sign up to request clarification or add additional context in comments.

2 Comments

May you(Anderi) fix my problem on fiddle please. I am unable to get inside value Please
You dont need the (key, value) since you are itterating over an array, just use "value in things.dietry_reqs". It's not wrong but might be confusing
0

I think you're looking for something like this:

var app = angular.module("Demo", []);
app.controller("AppController", function($scope) {
  $scope.things = {
    "attendance": [{
      "id": "14",
      "event_booking_id": "32",
      "seat_type": "",
      "fname": "",
      "lname": "",
      "email": "",
      "company": "",
      "dietry_reqs": [{
        "id": 1,
        "name": "delhi",
        "value": true
      }, {
        "id": 2,
        "name": "mumbai",
        "value": false
      }, {
        "id": 3,
        "name": "ahmedabad",
        "value": false
      }],
      "attend_status": "0",
      "created": "2016-05-05 11:24:56"
    }]
  }
});
<div ng-app="Demo">
  <ul>
    <li ng-repeat="a in things.attendance">
      <ul>
        <li ng-repeat="dr in a.dietry_reqs">
          <input type="checkbox" ng-model="dr.value" />{{ dr.name }}
        </li>
      </ul>
    </li>
  </ul>
</div>

Let me know. Thanks.

3 Comments

:( there some problem in my json because I am not getting proper result still now
if you check the jsFiddle link then you'll see it's working. What json result are you talking about?
which json posted on this question stackoverflow.com/questions/37027289/…

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.