I know basic angular and i am working on a project in which i hve this code
<div>
<a href="#!/views/products?productId=98" target="_blank">
<img src="images/x-{{product.productId}}.png"/>
</a>
</div>
Right now, I have productId as a hardcoded value. What i want that this productId is actually product.productId and in controller, I can use this productId when it is clicked to fetch further details.
Here is my ProductController
.controller('ProductCtrl',function($scope, $http) {
$http.get('http://localhost:8080/api/products').
success(function(data) {
$scope.product = data;
});
})
I want http://localhost:8080/api/products this to pass a queryParameter as http://localhost:8080/api/products?id=XX where id is product.productId from the html i put above.
How can i acehive this.