When I click on the view details button, I want to request JSON data and then construct a modal view over the content.
HTML:
<a href="#">View Details 1</a>
<a href="#">View Details 2</a>
<a href="#">View Details 3</a>
Get JSON:
function MyCtrl($scope){
$http.get('json/story.json').success(function(data){
console.log(data);
$scope.story = data;
});
}
What is the best practices to run this MyCtrl function using angular.js when a user clicks on the detail button? Also the HTML above is being printed out using another controller. I hope there is some way to bind the clicks versus hard-coding ID's and such in the links.