Hi There,
I am facing a problem to block href click event for an a tag. I written a
custom directive to block the click event,
myapp.directive('a', function($compile) {
return {
restrict: 'E',
link: function(scope, elem, attrs) {
elem.bind('click', function(e){
var hrefURL = attrs.href;
var directURL = hrefURL.indexOf(BlogInfo.url);
e.preventDefault();
});
}
}
});
But the actual problem is, there is a set of data coming from $http server
call. The data includes content with a href tag, so using innerHTML
(ng-bind-html='postContent') I am rendering the content with a href.
for server content with a href the click event is not triggering..
Anyone having a solution, Thanks in Advance
--
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.