Here i use ionic framework and angularjs, I have a servces like
app.service('MyService',function($scope){
var value = $scope.product;
return value;
});
and my controller is
app.controller("firCtrl",function($scope,$state,MyService){
$scope.product = ['gopi','dinesh','vasu','prasanth'];
//MyService.value = $scope.product;
console.log($scope.product);
$scope.doClick = function(){
console.log('invoke');
$state.go('second');
};
});
my second controller is
app.controller("secCtrl",function($scope,MyService){
$scope.product2 = MyService.value;
});
here i have value in my product and this value is displayed in a first page and i have a button in fist page to show the value in product to second page. I'm not getting any idea for viewing my array in list in the second page.
when i use ng-repeat in the first page i am able to display the value and my button but when I click the button i am not able to view the data in the second page