I'm trying to figure out the best way to take a json object which I'm storing as a scope, and filter/query it to display specific data from within it.
For example:
$scope.myBook = {"bookName": "Whatever",
"pages": [
{"pageid": 1, "pageBody": "html content for the page", "pageTitle": "Page 1"},
{"pageid": 2, "pageBody": "html content for the page", "pageTitle": "Page 2"},
{"pageid": 3, "pageBody": "html content for the page", "pageTitle": "Page 3"},
]
}
How would I go about grabbing the object for pageid:2 ?
pageBodyforpageid: 2? – ForgetfulFellow Jul 21 '14 at 0:25for()to find the necessary page, then usefoundPage.pageBody– zerkms Jul 21 '14 at 0:29