forgottofly forgottofly - 1 year ago 99
Javascript Question

ng-repeat not pushing data

I'm using ng-repeat directive to list a set of JSON data of the format

"id": 84,
"resource": {
"id": 3,
"name": "Resource Planning",
"description": "test"
"activity": {
"id": 6,
"name": "Activity Planning",
"description": "test"

My usage of ng-repeat is like this..

<div ng-repet="data in result">{{}} {{}}</div>

I'm able to display the name ie., "Resouce Planning" and "Activity Planning".
But I can't push the data if I'm doing like this


from the controller.
Is there any way to push the name which is inside the object. And to display/list the same using ng-repeat?

Answer Source

I don't really understand the question, but that's not how you build your javascript object. It should be something like:

       resource: {
       activity: { 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download