Skip to content

'ng' attribute namespace  #55

@bisubus

Description

@bisubus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions