I am struggling with creating a list of items that, when clicked, should take me to the corresponding post. Despite trying to use ng-click in the header, I suspect there is an issue with the route not functioning properly.
As part of my testing process, I have included a line where clicking on "VIEW" should trigger the function mentioned earlier. My assumption is that the problem may be related to how I've defined states in app.js and how they are implemented in $state.go.
Any assistance would be greatly appreciated. Thank you!
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> <!-- Clicking VIEW doesn't do anything-->
The JS File:
using 'tab.view' isn't effective.
$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'