Refactoring of row events using $scope.$emit