if($routeParams.categoryId.length != 0)
{
angular.forEach($rootScope.categories, function(value, key){
if(value.id == $routeParams.categoryId)
{
$scope.selectedCategory = $rootScope.categories[key];
}
});
}