Here is a suggestion for your controller implementation.
1: First, select the element and remove any unnecessary attributes like
element.removeAttribute("target"
);
2: Next, add the required attribute to the element using
element.setAttribute('ng-click', 'loadMicrosite(messageItem.id)'); //you can concatenate strings for messageItem.id
3: The updated element is now in the DOM but not yet connected to the scope. Utilize $compile for this task. According to the Angular documentation, $compile
Compiles an HTML string or DOM into a template and generates a template function, which can then be used to link the 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>