Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
AngularJS Search html - solo contenido

Tengo la directiva ng-bind-html en el html y el filtro en el archivo .js:

 .filter('highlightKeywords', function($sce) { // returns all words in a sentence as an array, ignoring extra whitespace var stringToArray = function(input) { if(input) { return input.match(/\S+/g); } else { return []; } }; // returns regex that basically says 'match any word that starts with one of my keywords' var getRegexPattern = function(keywordArray) { var pattern = "(^|\\b)(" + keywordArray.join("|") + ")"; return new RegExp(pattern, "gi"); }; return function(textToHighlight, keywords) { var filteredText = textToHighlight; if(keywords !== "") { var keywordList = stringToArray(keywords); var pattern = getRegexPattern(keywordList); console.log(pattern); filteredText = textToHighlight.replace(pattern, '<span class="highlighted">$2</span>'); } return $sce.trustAsHtml(filteredText); //return filteredText; }; });

Esta solución busca html completo (con etiquetas). Quiero buscar solo contenido html. ¿Como hacer eso?

Gracias

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda