I am having some difficulty getting routeParams to work for my site. I am attempting to have a list of groups displayed with the ability to select one and be routed to a page with that groups specific details. I asked a similar question yesterday but don't think I knew exactly what to ask for. The way I have it set up now I only see '/#/viewgroup/:id' in the browser instead of the actual id number and the page is blank. Thank you for the help!
ROUTES:
.whenAuthenticated('/viewgroup/:id', {
templateUrl: 'views/groups/groupDetail.html',
controller: 'GroupCtrl'
})
INDEX.HTML:
<div class="col-md-4" ng-repeat="group in data.groups | filter: filterObject | filter: search">
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a href="#viewgroup/:id">{{group.name}}</a></h5>
</div>
GROUPDETAIL.HTML:
<div ng-show="group in data.groups">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Groups</a></li>
<li class="active">{{group.name}}</li>
</ol>
GROUPCTRL: I am only using the 'groups/data.json' for the data because I am not sure how to pull in this data from the firebase server. Pulling from the server is really what I need.
creativeBillingApp.controller('GroupCtrl', ['$scope', 'groupsService', '$routeParams', function( $scope, groupsService, $firebase, $routeParams, $http) {
$http.get('groups/data.json').success(function(data){
angular.forEach(data, function(item) {
if (item.id == $routeParams.groupId)
$scope.group = item;
});
});