I have created an ionic list, what I am not sure of doing is being able to click on the items to take you to another list.
so the first list is hard coded into the main.html
I want to be able to click on item list to be able go to the secondary list which has a json. the hard part is the controller for that ngular. I am a newbie any assistance will be greatly appreciated.
kind regards
simon peter
You need to pass first list id to second controller and catch first list id on second controller and then get second list on the basis of first list id.
Are you using stateprovider ?
`//states
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state(‘app’, {
url: ‘/app’,
templateUrl: 'templates/main.html'
})
.state(‘app.itemList’, {
url: ‘/itemList’,
templateUrl: ‘templates/itemList.html’,
controller: ‘restController’
})
$urlRouterProvider.otherwise(’/app’);
})
//Controller for the second list.
.controller(“restController”, [’$scope’, ‘$http’, function($scope, $http){
$http.get(‘js/resturants.json’).success(function(resturants){
$scope.restList = resturants;
});
}]);`
Yes I use $stateProvider, please modify my controller as you think It can work.
thanks, let me check it out