I was able to load a drop-down using php. Now I need to load the second drop-down, based on the first selection.
Does anyone know how to do this?
Thanks.
<body ng-app="app" ng-controller="statecontroller">
<label>Categorias</label>
<select ng-model="categoria">
<option value="">Selecione</option>
<option ng-repeat="x in categorias" value="{{ x.id_categoria }}">{{ x.categoria }}</option>
</select>
<label>Subcategorias</label>
<select ng-model="subcategoria">
<option value="">Selecione</option>
<option ng-repeat="x in subcategorias" value="{{ x.id_subcategoria }}">{{ x.subcategoria }}</option>
</select>
<script src='js/angular.min.js'></script>
<script>
var app = angular.module("app",[]);
app.controller("statecontroller", ['$scope', '$http', function ($scope, $http) {
$http.get("php/carregaCategorias.php").success(function(response) {
$scope.categorias=response;
});
}]);
</script>