I'm not sure if I'm approaching this correctly but I'm building an ecommerce site - part of the site has 6 different product grid pages, each of which can use the same view:
<ul class="products row">
<li class="product thumbnail col-1 grid" ng-repeat="whisky in whiskies | orderBy: sort">
<p class="picture">
<a ng-href="#/json/{{whisky.id}}"><img ng-src="images/scotch/{{whisky.imageUrl}}" alt="{{whisky.name}}"/></a>
</p>
<div class="desc">
<h2>{{whisky.name}}</h2>
<p class="price"><span>£{{whisky.price}}</span></p>
</div>
<div class="actions">
<button class="add-to-basket btn btn-primary btn-medium fa fa-shopping-cart" data-item='{"imageUrl" : "{{whisky.imageUrl}}", "price" : "{{whisky.price}}", "startPrice" : "{{whisky.price}}", "name" : "{{whisky.name}}", "totalItems" : "{{1}}"}' ng-click="updateMiniBasket($event)"></button>
</div>
</li>
</ul>
and the same controller:
whiskyControllers.controller('whiskyListCtrlr', ['$scope', 'whiskyList', '$http',
function($scope, whiskyList, $http){
whiskyList.getWhiskies().then(function(d) {
$scope.whiskies = d.data;
})
}
])
but need to have a different route in the route provider config i.e. one goes to scotch, one goes to irish, one to japanese etc.
How do I code the routing so that the different pages share the same controller and view? Is it maybe possible to pass parameters from the router to the controller?
Many thanks