0

I am trying to create a chat box in angular, I made it some how but I feel the code is wrong when I click the members it show different member. Please someone correct the code here the link to Plunkerlink

1 Answer 1

1

$index will give you the index of the ordered item in UI(After Applying ngRepeat and orderBy) not in the index of the item in the data array. To elaborate this behavior, When I select the artist name "Hassum Harrod" the $index will return me the value as 2 but the same data is available at the index 3 from your data.json. You can pass the item itself to your AppendText(item) . I have modified your plnkr.

I hope it helps

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

1 Comment

Thanks, it's really helpful.

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.