Refactoring of label events using $scope.$emit