I have a collapsed model which show more information about client, and insid it, I have a button, when I click, I don't get the informations of the specific client, I get data of all clients
<ion-list ng-repeat="x in names"> <a class="item item-icon-left " > <i class="icon ion-android-arrow-dropdown-circle" ng-model="collapsed" ng-click="collapsed=!collapsed"></i> {{x.Marque}} </a> <div ng-show="collapsed"> <table> <thead > <td> <label> Code: </label> {{x.CodeClient}} <br/> <label> Nom: </label> {{x.NomClient}} <br/> <a class="button button-info" ui-sref="modifClient({CodeClient: x})" > Enregistrer </a> ... app.js
$stateProvider.state('modifClient', { url: '/modifClient', templateUrl: 'templates/modifClient.html', params: {CodeClient: null}, controller: 'ConsultClientCtrl' }); app.controller("ConsultClientCtrl", function($scope, $http) { $scope.loadClient = function(){ $http.get("http://localhost/deb/debut.php") .success(function(data){ $scope.names = data; }); } });
modifClient.html
<ion-content class="padding" ng-controller="ConsultClientCtrl" ng-repeat="x in names | filter: {CodeClient: thisX}" > <ion-list ng-repeat="x in names | filter: {CodeClient: thisX}: true"> <div class="item item-divider center-text" ng-model="CodeClient"> {{x.CodeClient}} </div> ......