0
I was able to load a drop-down using php. Now I need to load the second drop-down, based on the selection of the first.
Someone knows how to do it?
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>
Add the code.
– user28595
I don’t have code @Diegofelipe
– GustavoSevero
Gustavo, do the same thing for function uploadCategories.
– Cleiton
Even though this part is working?
– GustavoSevero
Dude, I said shit. I’m sorry. I’m not moving. LOL. What’s the status now? What’s going on?
– Cleiton
Ta the way it is in the description. See above Cleiton
– GustavoSevero
Hey, guys, any more tips?
– GustavoSevero
It includes a workable solution in my question, it also follows a link to a Fiddler https://jsfiddle.net/ybjpvopn/, I hope it helped.
– Cleiton