Hello,
I have some string in messageBody that may contains some hyperlink. I would
like to disable this based on specific condition. Could you please help me
for the same. Currently I am doing this using regex pattern but someone
suggested me that $sce.trustAsHtml( returns html element so we can disable
this easily.
var messageBody = self.SelectedMessage.Body;
//'AllowOpeningHyperLinksInMessages' is false then
disable all hyperkinks available in message body
if (!appConfig.AllowOpeningHyperLinksInMessages) {
messageBody = messageBody.replace(new
RegExp(regexPatternSearchHyperlinks, "gi"), disableHyperlinkPattern);
}
self.SelectedMessageBody =
$sce.trustAsHtml(messageBody);
So, basically I would like to remove line - 3,4,5 and disable the link that
is available in self.SelectedMessageBody (result of $sce.trustAsHtml ).
Regards,
Manish
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.