While Angular and ngSanitize commands sort this out, I found this topic useful to create a workaround. In particular, an answer speaking with a dynamically defined property .
Binding to is-open
with this property, I was able to connect click handlers on the binding tags after ngSanitize completed the disinfection.
In this case, the HTML after disinfection, note that I use cite
to store the target binding identifier, as this is one of the attributes that ngSanitize ignores. (You can try using href
, but I would like to leave this alone):
Please see <a href='#' cite='#another_faq'>here</a>
The code in the installer for the property (see the link above) then processes the DOM events, which, it seems to me, contradict the Angular methodology, but sometimes you have to stop hitting your head and make it work:
if (isOpened) $('p.faq.answer').eq(item.position).find('a[cite]').each -> $(this).bind 'click', () -> $($(this).attr('cite')).click()
And then make sure that in this case you have the correct anchor with the target identifier #another_faq
.
source share