J'utilise ng-table Comment puis-je effectuer une recherche en utilisant regex au lieu de string?Comment filtrer en utilisant regex dans ng-table?
Répondre
Vous pouvez utiliser filterComparator dans ngTableParams sur mesure:
$scope.tableParams = new this.ngTableParams({}, {
filterOptions: {
filterComparator: function(actual, expected) {
return typeof actual == 'string' && actual.match(new RegExp(expected, 'i'));
}
}
});
Vous demandez et réponse en même temps ?? –
@LucasCosta http://stackoverflow.com/help/self-answer, http://meta.stackexchange.com/questions/17845/etiquette-for-answering-your-own-question – Andreas
@Andreas merci pour les docs. –
http://ng-table.com/#/filtering/demo-customize-algorithm – Andreas