It's because mouseover
initiates the loop everytime you move your mouse. It's just not possible to do a click.
You need to keep a flag (boolean) when the mouse is over your element and reset this flag when your mouse moves out of your element.
Something like this:
JS
$scope.initOver = false;
$scope.resetOver = function() {
$scope.initOver = false;
}
$scope.getSimilar = function (index) {
if($scope.initOver == false) {
$scope.work.similar = [{
id: '1',
title: 'First'
}, {
id: '2',
title: 'Second'
}, {
id: '3',
title: 'Third'
}];
$scope.initOver = true;
}
};
HTML
<button type="button" class="btn btn-sm btn-primary skills" ng-repeat="skill in work.skills" ng-Mouseover="getSimilar($index)" ng-Mouseleave="resetOver()">