I have successfully built a webpage that displays JSON data based on the selected link. However, I am facing an issue where I need to show the first JSON data object before selecting any link (initially).
Check out the Plunker demo here: http://embed.plnkr.co/SPbvgPhfdeCqZG0yzzeZ/
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
... (HTML code continues)
JSON Data:
[
{
"id": "1",
"title": "cube",
"content": "cube 1 cube",
... (JSON data continues)
},
{
"id": "2",
"title": "Gallery",
"content": "Gallery 2 Gallery",
... (more JSON data)
}
]
JavaScript:
// Modules and controllers setup
... (JavaScript code)
function myFunction(e) {
... (function for handling click event)
}
Remember to visit the Plunker link above to see the live demo. If you have any suggestions on how to display the initial JSON data object without selecting a link, feel free to share them.