0
私はすでにたくさんのものを検索しましたが、助けになりません。私は私のデータをこのようになるようにします:angjjsのphpからjsonデータを取得する方法
$scope.places = [{name: 'John'},{name: 'Jane'}];
私の問題は、このことを達成する方法は分かりません。それを行うにはどのように
$scope.getNames = function(){
$http.post('get',{}).then(function(response){
$scope.places = response.data;
});
};
$scope.getNames();
PHP
$sql = "SELECT * FROM tblplace";
$res = $con->query($sql);
while($row = mysqli_fetch_array($res)){
// code here.
}
HTML
<select class="form-control places">
<option value="empty">Select</option>
<option ng-repeat="place in places" value="{{place.name}}"> {{place.name}}</option>
</select>
:Here'e私angularjsは次のようになりますか?ありがとう!
ありがとうございました!できます! – duterte
うれしい私は助けることができます。 :D –