Skip to content

Conversation

@danielgranat
Copy link
Contributor

Hi there,

I recently needed to change the flow when a user clicks on the progress button, and before starting the progress the user needs to confirm the action he is about to make. To allow this i added another optional attribute for custom-event, in which case instead of binding to the click event, i bind to the custom event.

After the change, by button html looks like this:

<button custom-event="start-progress" ng-click="submitClick($event)" progress-button="submitPromise()">Submit</button>

My submit click function looks like this:

$scope.submitClick = function($event){
  confirmSubmitDialog.show(function() {
    $($event.currentTarget).trigger('start-progress');
  });
}

Another change i had to make to support this is when an event is triggered, to change the $scope.apply() to $timeout, because a digest may already be in progress.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant