I have select option code:
<select ng-init="loadHouse()" name="house" ng-model="house" class="form-control">
<option value="">Select House</option>
<option ng-repeat="house in houses" value="{{house.hid}}">{{house.hname}}</option>
</select>
Script:
$scope.loadHouse = function(){
$http.get("Unity/load_house.php")
.then(function(data){
$scope.houses = data;
console.log(data);
})
}
And load_house.php
include('../config/config.php');
require 'model/model.unity.php';
$insertHouse = loadHouses();
while($row = mysqli_fetch_array($insertHouse)){
$output[] = $row;
}
echo json_encode($output);
It seems to work and I am able to print data inside console. But inside option its empty:
What can be the problem?
EDIT Here is console data: