0

I am using angularJS and have a javascript array of objects, each object has

Count
ID
Subject

I would like to use this array to populate a with these values:

                            <dl>
                                <dt>Count</dt>
                                <dd>Subject</dd>
                                  <!--all objects should appear as above-->  
                            </dl>

Is there a way to do this?

2

2 Answers 2

1
$scope.yourArray = [
    {"Count": "something1", "ID":  "something2", "Subject":  "something3"},
    {"Count": "something1", "ID":  "something2", "Subject":  "something3"},
    {"Count": "something1", "ID":  "something2", "Subject":  "something3"},
    {"Count": "something1", "ID":  "something2", "Subject":  "something3"}
]; // On the controller

<dl ng-repeat="item in yourArray">
    <dt>{{item.Count}}</dt>
    <dd>{{item.Subject}}</dd>
</dl>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer
1

Try this:

<dl ng-repeat="myDataItem in myDataArr">
  <dt>{{ myDataItem.Count }}</dt>
  <dd>{{ myDataItem.Subject }}</dd>
</dl>

Comments

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.