I'm using AngularJS to create a site.
There's my array:
$scope.replyList = [
{
"id": "85485",
"reply_content": "aaaaaaa",
"reply_gender": "1",
"reply_author": "John"
},
{
"id": "85487",
"reply_content": "bbbbbbb",
"reply_gender": "1",
"reply_author": "Ben"
},
{
"id": "85504",
"reply_content": "ccccccc",
"reply_gender": "1",
"reply_author": "Wang"
}
]
What I want to do is update the item value by a given key id.
For example, I'd like to update the content with id 85485. How can you deal with that?
$scope.replyList[{id: 85475}].reply_content = 'dddddd'; /* failed */
Thank you very much.