I have a search form with 2 selects and 1 submit:
<select ng-model="marca" ng-options="marca.nome_marca for marca in marcas" ng-change="changeMarca()">
<option value="">Selecione uma Marca</option>
</select>
<select ng-model="modelo" ng-options="modelo.nome_modelo for modelo in modelos|filter:{marca_id:marca.marca_id}" ng-change="changeModelo()">
<option value="">Selecione um Modelo</option>
</select>
<button ng-Click="???">BUSCAR</button>
How can I display the result of this search in another view, specifically the route I've already separated for it: #/busca/:marca_id/:modelo_id
I do not know if it was clear, I already have the routes all, I just need to send this to the search controller below:
angular.module("myApp").controller("buscaCtrl", function($scope, $http, $routeParams, estoqueAPI) {
$scope.loading = true;
$scope.buscaMarca = $routeParams.marca_id;
$scope.buscaModelo = $routeParams.modelo_id;
var carregarEstoque = function () {
estoqueAPI.getEstoque()
.success(function (data) {
$scope.carros = data;
}).finally(function() { $scope.loading = false; })
};
carregarEstoque();
});