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

422
Views
What does $on.constructor do in AngularJS?

I was performing an XSS challenge on PortSwigger labs here.

This is the solution to their XSS challenge

{{$on.constructor('alert(1)')()}}

However, with no prior experience in AngularJS I am rather lost. I was told that code within double curly braces {{ }} can be execute JavaScript expressions from anywhere in the code, providing the ng-app attribute (also known as an AngularJS directive) is somewhere in the HTML document. I also recognise alert(1) from ordinary JavaScript that creates a popup.

My question is what does the $on.constructor part do?

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