Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!