I have a list of items where ideally, upon clicking the item, would bring me to the post itself. I dont know how to have that..I tried ng-click within the header but i think the route itself isnt working.
For testing purposes, I have used a line where the work VIEW, upon clicking should lead to the function above. My suspect is the problem lies with the app.js states and how I define it in the $state.go.
Appreciate any help. Many thanks!
The main list html
<ion-view ng-controller="NavCtrl">
<div class="container posts-page">
<div class="post row" ng-repeat="(postId, post) in posts">
<a ng-click="view()">VIEW</a> <!-- the VIEW when clicked = no actions -->
The js file
using 'tab.view' doesnt work.
$scope.view = function() {
$state.go('tab.posts.view', {postId: postId});
};
The app.js state file
.state('tab.posts', {
url: '/posts',
views: {
'tab-posts': {
templateUrl: 'templates/tab-posts.html',
controller: 'PostsCtrl'
.state('tab.posts.view', {
url: '/:postId',
views: {
'tab-posts':{
templateUrl: 'templates/tab-showpost.html',
controller: 'PostViewCtrl'