Im working on a shoppingCart project and want to bring data into views dynamically so Im calling routeParams in template.html but it is arriving normally as checked via but it isnt working with ng-repeat.
index.html
<a style="cursor: pointer;" ng-href="#/store/{{something.name}}/{{ child.name }}">{{ child.display_name }}</a>
routing in app.js
when('/store/:Department/:Category', { templateUrl: 'partials/template.html', controller: storeController }).
controller.js
function storeController($scope, $route, $routeParams, $location, DataService) { $scope.name = "storeController"; $scope.$route = $route; $scope.$location = $location; $scope.$routeParams = $routeParams; $scope.Category = $routeParams.Category; }
store.js
function store() {
this.fruits = [
new product("APL", "Apple", "Eat one every day to keep the doctor away!", 12, 90, 0, 2, 0),
new product("BAN", "Banana", "These are rich in Potassium and easy to peel.", 4, 120, 0, 2, 1)];
}
template.html
<pre>$routeParams.Category = {{$routeParams.Category}}</pre>
I really need this to work otherwise I would have to call it like store.fruits,store.vegetables and would have to make separate files too for each of them. Please HELP