Last active
October 29, 2015 13:24
-
-
Save manuelbieh/dba5f6f35ed0dfa77730 to your computer and use it in GitHub Desktop.
Change all ng-* attributes to data-ng-*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.querySelectorAll('*')).forEach((el) => { | |
Array.from(el.attributes).forEach((attrib) => { | |
if(attrib.localName.startsWith('ng-')) { | |
el.setAttribute(`data-${attrib.localName}`, attrib.value); | |
el.removeAttribute(attrib.localName); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment