Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-disabled doesn't prevent state change #2957

Closed
CSchulz opened this issue Sep 1, 2016 · 3 comments
Closed

ng-disabled doesn't prevent state change #2957

CSchulz opened this issue Sep 1, 2016 · 3 comments

Comments

@CSchulz
Copy link

CSchulz commented Sep 1, 2016

I am using the ng-disabled to deactivate links but it seems the ui-router tries to go to the state:

<a ui-sref=".groups" class="btn btn-default" aria-label="Groups" ng-disabled="userController.create">
    <span class="db-icon-pencil small" aria-hidden="true"></span>Groups
</a>
Error: Could not resolve '.dcb' from state 'administration.benutzer.new'
    at Object.y.transitionTo (angular-ui-router.min.js:7)
    at Object.y.go (angular-ui-router.min.js:7)
    at angular-ui-router.min.js:7
    at angular.min.js:156
    at e (angular.min.js:45)
    at angular.min.js:48
@christopherthielen
Copy link
Contributor

Interesting. This seems like a pretty common scenario. I don't have time to implement it but I'd accept a PR to the master (1.0) branch.

An alternative is to disable pointer events using CSS

a[disabled=disabled] {
  pointer-events: none;
  cursor: default;
  color: grey;
}

@gideonaa
Copy link

gideonaa commented Sep 8, 2017

+1 for this

@stale
Copy link

stale bot commented Jan 24, 2020

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Jan 24, 2020
@stale stale bot closed this as completed Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants