Try like this in your controller.
1: select the element and remove unwanted attributes using
element.removeAttribute("target");
2: Add required attribute on the element using
element.setAttribute('ng-click', 'loadMicrosite(messageItem.id)'); '' you can use string concatenation for messageItem.id
3: Now you have the updated element in the DOM but its not attached with the scope yet. Use $compile for it. As per angular docs $compile
Compiles an HTML string or DOM into a template and produces a template function, which can then be used to link scope and the template together.
https://docs.angularjs.org/api/ng/service/$compile
var app = angular.module('app', []);
app.controller('mainCtrl', function ($scope,$compile) {
var sNew = document.querySelector('a');
sNew.removeAttribute("target");
sNew.removeAttribute("href");
sNew.setAttribute('ng-click', 'loadMicrosite(messageItem.id)');
$compile(sNew)($scope);
$scope.loadMicrosite = function(param)
{
alert("I am called");
}
});
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.min.js"></script>
</head>
<body ng-controller="mainCtrl">
<a target="_blank" href="http://sprintweb.abc.com/sos-children-s-villages-of-india-new-delhi-delhi"><b class="orange tdu">SOS Children's Villages of India</b></a>
</body>
</html>
$scopeto get thengClickrecognized.window.locationin your javascript function?