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

121
Visualizações
Strict Contextual Escaping in React JS

We are making a api call, and in response we get a url. In Angular JS, we can trust the url by using $sce.trustAsResourceUrl.

So what will be the equivalent of trustAsResourceUrl in React JS.

In Angular,

//Here response is my api response
var url = $sce.trustAsResourceUrl(response.url);

The above url to use in an iframe.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Since React doesn't bind URLs to resources like Angular can, the need for trusted resources doesn't occur.

Utilising the URL in a React app is something you do outside of the framework i.e. using fetch.

In essence, React doesn't manage your resources like Angular does because the resources are not bound to framework elements - unlike Angular's ng-src.

This is still the case when using an iframe. The src isn't bound to the component in the way that ng-src binds. Instead it's really just rendering the iframe and giving it the standard HTML attributes.

about 4 years ago · Juan Pablo Isaza Relatório
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