Мне нужно получить слаг из одного из моих постов, однако фильтр, который я предлагаю, не достигает этого тега, в основном фильтруя каждое сообщение по слагу
HTML
<div bindonce ng-if="catalogoIndicesV3" class="row fila-pareja" id="panelindice"
ng-repeat="indice in catalogoIndicesV3 |
filter:{indice.indice.slug:'internacional'}">
<div class="panel panel-default">
<div class="panel-body">
{{indice.indice.nombre}}
</div>
</div>
</div>
Контроллер
angular.module('indicesApp')
.controller('MainCtrl', ['$scope', 'apiIMCO', 'apiimcov3', 'utils2', '$location', 'apiService',
function($scope, apiIMCO, apiimcov3, utils, $location, apiService) {
//,indice-de-informacion-del-ejercicio-del-gasto
$scope.isFileType = function (string, extension){
return (new RegExp(extension+"$", "i")).test(string);
};
$scope.shortifyString = function (string){
return string.replace(/\s\W.*?$/, "");
};
apiService.getResource('/publicaciones?exclude_index=semaforo-del-sla')
.then(function(response) {
//console.log(response);
response.forEach(function (entry){
if(entry.url === null &&
( (typeof entry['introduccion'] !== "undefined" &&
entry['introduccion'].length>0) ||
(typeof entry['vistas'] !== 'undefined' &&
entry['vistas'].length>0)
)
){
if(entry.categoria === "Informe Legislativo")
{
entry.url = 'http://imco.org.mx/finanzaspublicas/#!/informe-legislativo';
}
else {
entry.url = entry.slug + '/' ;
}
}
});;
$scope.catalogoIndicesV3 = response;
});
$scope.buscaO = utils.buscaEnArregloObjetos;
}
]);
JSON
https://api.imco.org.mx/release/latest/publicaciones?exclude_index=semaforo-del-sla