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' attribute namespace #55

Open
bisubus opened this issue Oct 11, 2015 · 0 comments
Open

'ng' attribute namespace #55

bisubus opened this issue Oct 11, 2015 · 0 comments

Comments

@bisubus
Copy link

bisubus commented Oct 11, 2015

I suggest to translate directive attributes to custom namespace instead of 'ng'.

Using 'ng' in third-party extensions is unconventional, and I don't see it as a problem. The problem is that several core directives (ngModel, ngDisabled, etc.) are compiled on irrelevant elements, which is redundant or even harmful.

Another problem is that the code looks misleading when irrelevant ng-model or non-existing ng-* directives are featured.

Unprefixed loading attribute adds inconsistency. Was it by intention? There are other prefixed attributes that share the names with polymer elements (e.g ng-disabled).

I treated it like that for now. It is a bit dirty, but since the extension uses ES5, there are no computed properties, and regexp should be used anyway to prefix the attributes (it could be omitted if there were no unprefixed attributes like loading).

And the usage is

angular.module('ng-polymer-elements').constant('$ngPolymerPrefix', 'pe');

I guess that the extension could keep 'ng' as default prefix for now and feature breaking changes at any moment when appropriate.

And thank you for tremendous work, it is appreciated.

@GabiAxel GabiAxel reopened this Nov 8, 2017
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

No branches or pull requests

3 participants