I am making a shopping application in ionic/ angular JS. I want to pass a value (name of my subcategory) from my subcategory page to the detail page. Here is my code:
Subcategory.html
<div>
<ion-view view-title="SubCategories">
<ion-list>
<ion-item class="ionitems" ng-repeat="sublist in subCategories" href="#/app/playlists/{{sublist.id}}/details">
{{sublist.name}}
<!--<a ng-click="godetails();">{{sublist.name}}<a/>-->
</ion-item>
</ion-list>
</div>
Detail page:
<ion-content>
<h4>Product Details</h4>
<ion-view view-title="playlists">
<ion-content ng-controller="PlaylistCtrl">
<input type="button" ng-click="addToCart();" value="add cart" />
</ion-content>
Add to cart controller:
.controller('detailsCtrl', function($scope){
var arr = [];
$scope.addToCart = function () {
arr.push("");
I need to pass the subcategory name from the subcategory page to detail page and to the add to cart controller. How can I do this?