3
Hello, I am passing a parameter through my route and need to rescue records with this parameter through an ng-repeat.
$routeProvider.when("/detalhe/:placa", {
templateUrl : 'view/detalhe.html',
controller : 'detalheCtrl'
});
But I’m not getting it on my ng-repeat filter:
<div ng-repeat="item in items | filter: {placa: ???}">
{{item.nome}}
</div>
Does anyone have any idea how I can look into this? Because I have searched and have found only references to filters in input search engine.
This is my controller:
angular.module("myApp").controller("detalheCtrl", function($scope, $http, estoqueAPI) {
$scope.loading = true;
var carregarEstoque = function () {
estoqueAPI.getEstoque()
.success(function (data) {
$scope.carros = data;
}).finally(function() { $scope.loading = false; })
};
carregarEstoque();
});
Show your controller "detail", so we can help you!
– Fernando Leal
Ready Fernando, my controller is the one I posted.
– Fábio Duarte
Edited question, thanks for the comments. Any idea on solution of my problem Fernando?
– Fábio Duarte