Find an element from $sce.trustAsHtml

34 views
Skip to first unread message

Manish Rai

unread,
Jun 23, 2015, 6:43:25 AM6/23/15
to ang...@googlegroups.com
Hello,

I need to find an link available in variable that contains data from $sce.trustAsHtml.

self.SelectedMessageBody = $sce.trustAsHtml(messageBody);

self.SelectedMessageBod contains few hyperlinks that I need to disabled using $("a").click(function() { return false });
 
Kindly suggest me the best options for the same.

Regards,
Manish 

Sander Elias

unread,
Jun 24, 2015, 3:56:58 AM6/24/15
to ang...@googlegroups.com

Hi Manish,

The best way to handle this, is create a small attribute directive that watches your SelectedMessageBody and then do a $element.find('a) on the next digest.

Regards
Sander

Manish

unread,
Jun 24, 2015, 4:56:08 AM6/24/15
to ang...@googlegroups.com
Hi Sander,

Thanks for the reply. Could you please help me with example, actually I am new to the angular.

Regards,
Manish

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/7TDM5G26zrs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages