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

118
Views
Issue with ng-click event not firing for HTML rendered from SQL Server database

I render a button saved from SQL Server database. View source for the button looks like the following -

<button id="btn" class="mainBtn" ng-click="OpenBtn('btn')" >Do something</button>

This button is part of a MainDiv which looks like following -

<div id="MainDIV"  ng-bind-html="MainDIVHTML">

I assign MainDIVHTML value as follows -

 $scope.MainDIVHTML= $sce.trustAsHtml(entity.MainDIVHTML);

Where entity.MainDIVHTML is the saved HTML from database.

mainBtn is inside the entity.MainDIVHTML

The saved HTML and the page where I am using saved HTML share the Angular.js controller.

I am not able to execute - ng-click="OpenBtn('btn')" event.

The markup (HTML) is shown correctly though.

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!