0

suppose there are so many fields in js object and i want to load only few not all. i was searching on this for getting answer. i got one but i am not sure this is right one.

see the fiddle http://jsfiddle.net/vojtajina/js64b/14/

see this code ng:repeat="(i,th) in head" this is the way where we need to specify something in bracket. i have confusion here. so anyone can help me to understand how to load few selected data with ng-repeat. thanks

3
  • What do you mean by not them all ? If your client side you have either already your whole objects or you have filtered bojects from server. Otherwise check the answer there stackoverflow.com/questions/19349881/…. You could filtered all required fields in your controller into another list which you can bind to the scope so it won't be too heavy. Commented Apr 18, 2016 at 15:15
  • just tell me what kind of code it is ng:repeat="(i,th) in head" what the code is doing? what will be store in i & th ? Commented Apr 18, 2016 at 15:25
  • it seems that you luck basic knowledge of how ng-repeat works please have a look on the documentation and read on my answer, if further explanation is needed i would be happy to update the answer Commented Apr 18, 2016 at 16:18

1 Answer 1

1

If i understand correct you want to know what the (i,th) values print:

First i suggest that you read on the ng-repeat documentation

i is the key of your object and th is the value:

scope.head = {
    a: "Name",
    b: "Surname",
    c: "City"
};

So for this object example that your provided i equals to a,b,c and th equals to "Name", "Surname","City"

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

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.