Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda