hello everyone i have some trouble returning a result from a function ,
i made a select input with ng-change
the result of ng-change
is used by an API then displays the result in a table the issue is i can't use the result out of the function
Here's my html page
<select ng-model="dvdv" ng-change="update()" class="form-control" >
<option value="" disabled selected>Veuillez sélectionner un DVD</option>
<option ng-repeat="d in dvd" value="{{d}}"> {{d}} </option>
</select>
The table were data should be displayed
<table class="table table-bordered" >
<thead><tr class="infoti" >
<th>Id Dev</th>
<th>Nom Dev </th>
<th>Nom Ecu</th>
<th>Etat</th>
<th>Action</th>
<tr>
</thead>
<tbody>
<tr dir-paginate=" dev in devs | itemsPerPage:7| filter: search">
<td>{{dev[0]}}</td>
<td>{{dev[1]}}</td>
<td>{{dev[2]}}</td>
<td>Non Validé</td>
<td><button class="btn btn-default">Validé</button></td>
</tr>
</tbody>
</table>
and this is the Function am using to get the data from select input by ng-change
and am consuming
$scope.devs=[[]]
$scope.update=function(){
console.log($scope.dvdv)
$http.get("/dev?nommag="+$scope.dvdv)
.success(function(data){
$scope.devs = data ;
console.log($scope.devs)
})
}
here's a pic to explain how i want it to work
when i select an option i get the data then displayed but it's not printed in the table below else it work for a static so there's no issue with the syntax or ng-repeat