Skip to content

Instantly share code, notes, and snippets.

@kuanyui
Last active April 9, 2020 08:09
Show Gist options
  • Save kuanyui/c23a0dffa0d86958402a2640deab6cdc to your computer and use it in GitHub Desktop.
Save kuanyui/c23a0dffa0d86958402a2640deab6cdc to your computer and use it in GitHub Desktop.
[AngularJS] Remove the directive of lower priority? (e.g. ng-disabled)

https://stackoverflow.com/questions/61101750/angularjs-remove-the-directive-of-lower-priority

Train of Thought

  1. Remove ng-disabled before it compiled
  2. Watch disabled attribute of the DOM

    Sounds stupid. And performance?

  3. Use CSS + class to fade the <button>

    -No. pointer-events cannot avoid <button> from triggered with [TAB] key.

  4. Write a new directive to replace ng-disabled (priority: 100) . ex: my-disabled (priority: 101)

    WIP

  5. Copy the HTML and create new DOM without ng-disabled directly?

    WIP

  6. Implement our ng-disabled-liked directive to replace ng-disabled (Totally get rid of ng-disabled)

    WIP

Other issues

  1. After disabled, tooltip / title becomes unavailable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment