I'm not sure that you can override the browsers handling of alert. You would at least need to change (find and replace) your Alert code with maybe an injected factory...
The benefit here is that you can inject modalFactory in any controller you need to raise a modal from (which might be all of them) and reuse that code consistently. While it doesn't answer your question of overriding Alert it does provide you a way to programatically show your modal element. here is the plunk http://plnkr.co/edit/0QNxUrQ7DH101VrFD0Me?p=preview hope it helps.
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope, modalFactory) {
$scope.name = 'ttt';
$scope.RunProcess = function() {
//error occured
modalFactory.show($scope);
}
$scope.Reset = function() {
modalFactory.hide($scope);
}
});
app.factory('modalFactory', function() {
return {
show: function($scope) {
$scope.showModal = true;
},
hide: function($scope) {
$scope.showModal = true;
}
}
});
Then in your view
<body ng-controller="MainCtrl">
<div class="my-modal" ng-show="showModal">
blahhh
</div>
<p>Hello {{name}}!</p>
<div>
<button ng-click="RunProcess()">button that runs a controller method and throws alert</button>
</div>
</body>