i hope someone can help in here… the stateParams not works for me,
i have data save in service,
a products page with list of the items
and product details page (where i want to show the selected item details).
currently i have the below:
service where i keep my products data:
.service(‘ServDataProducts’, [function(){
var Product = [
{code:1111, name: “nameA”, brand:“AAA”, price:10},
{code:2222, name: “nameB”, brand:“BBB”, price:20},
{code:3333, name: “nameC”, brand:“AAA”, price:30}
];
return Product
products page where i show the list of the items:
$scope.Product = ServDataProducts;
in the html list i show the items with ng-repeat = x in Product
and i show the product name with {{x.name}}
and in this product name i have ng-click to: goToPageProductDetails()
$scope.goToPageProductDetails = function() {$state.go(‘pageProductDetails’, $scope.selectedItem)}
up to here all works, now i have this product details page that i want to show the selected item details:
page name: pageProductDetails
i call the data from the service:
$scope.selectedItem= ServDataProducts;
here i go lost… what i should write in this page in order to show the selected item {{x.code}}, {{x.name}} etc. ??
how do i pass to this page the item details i select from my list???