I have a grid view displaying data from my database, with each title representing a separate box. When a title in the grid view is clicked, I want to redirect to a corresponding screen. How can this be achieved?
For example, clicking on "Orders" should redirect to order.html and clicking on "Delivery" should redirect to Delivery.html. Is there a way to achieve this using id or name?
Updated:
.controller('MydashCtrl', function($scope, $state) {
$scope.Data = [{
"id": "1",
"name": "Orders",
"Image": "http://img.21food.com/20110609/product/1306576307495.jpg"
},{
"id": "2",
"name": "Delivery",
"Image": "https://www.wildflavors.com/NA-EN/assets/Image/bakery.png"
},...
{
"id": "6",
"name": "Re-Orders",
"Image": "http://royalnutrimakmur.com/img/productImg02.jpg"
}]
$scope.changestate= function(name) {
if(name === "Orders"){
$state.go('reorder', { details: JSON.stringify(name) });
}else if(name === "Delivery"){
$state.go('dashboarddetail', { details: JSON.stringify(name) });
}
}
})
My Html code:
Issue: The title content is not showing up on the redirecting screen.
Sample Code for Redirect Screen - Order Title:
Screen HTML code:
<ion-view cache-view="false" title={{singleDetail.name}} hide-nav-bar="false" class="">
Controller code for this html:
.controller('reorderCtrl', function($scope, $state, $stateParams){
$scope.singleDetail = JSON.parse($stateParams.details);
})
There might be an issue with the home grid view controller affecting the appearance of title content on the redirecting screen.