Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Remove 'data' prefix from attributes #774

Merged
merged 1 commit into from
Aug 26, 2015
Merged

Conversation

rhutchison
Copy link
Contributor

Remove the 'data' prefix from custom attributes.

@lirantal
Copy link
Member

lirantal commented Aug 8, 2015

@ilanbiala per your request...

@lirantal lirantal added this to the 0.4.x milestone Aug 8, 2015
@trainerbill
Copy link
Contributor

Doesn't this go against HTML validation standards? data- is supposed to be included anytime you have a custom attribute not defined by W3C. I like the data-

@codydaig
Copy link
Member

@trainerbill The angular style guide that I personally refer back too (and I think it's been mentioned before in a previous issue) never even references using data-. I'm not familiar with how it plans into validation standards though.
https://github.com/johnpapa/angular-styleguide

@lirantal
Copy link
Member

ng-submit kind of custom attribute is probably not valid by W3C, but the data-ng-submit is valid. I'm not sure what reasons did @ilanbiala had about removing it

@pgrodrigues
Copy link
Contributor

Personally, Im going to keep data- prefixes in my apps due to W3C validation tests and also to avoid future HTML browser implementations that might create conflicts with ng- attrs which I'm pretty sure there won't be any, but from my point of view it's safer and since it is defined in the HTML5 spec why not keep them? :D

@lirantal
Copy link
Member

yeah I'm not sure why we removed it, need to wait for Ilan's response here

@ilanbiala
Copy link
Member

Data- was just to comply with XHTML IIRC. HTML5 allows all kinds of custom attributes if I'm not mistaken and syntax highlighters will work with either one. data- also just adds extra characters and makes everything longer. Anyway Some Angular HTML sometimes doesn't pass through W3C (and we know that isn't what necessarily makes a page better), so I don't see why we should try to conform more towards it.

@lirantal
Copy link
Member

HTML5 is also strict about the attributes type and it would prefer a data-* over plain custom.
Since AngularJS normalizes those attribute names I don't think it's worth any hassle to remove the data-* version that we have.

Unless there's a strong argument in removing data-* I think we can close this PR.

@ilanbiala
Copy link
Member

@lirantal I don't really care, but we shouldn't be inconsistent and I see no reason to do data- when almost no one does.

@lirantal
Copy link
Member

I haven't seen a strong argument towards removing data-* attributes so I'm not 100% convinced about removing it.

@rhutchison rhutchison mentioned this pull request Aug 20, 2015
15 tasks
@rhutchison rhutchison force-pushed the remove-data-prefix branch 2 times, most recently from 1554884 to 7e022ab Compare August 23, 2015 05:03
@codydaig
Copy link
Member

LGTM :-D
👍

@lirantal lirantal assigned lirantal and unassigned ilanbiala Aug 26, 2015
lirantal added a commit that referenced this pull request Aug 26, 2015
Remove 'data' prefix from attributes
@lirantal lirantal merged commit ff59de0 into meanjs:master Aug 26, 2015
@rhutchison rhutchison deleted the remove-data-prefix branch August 27, 2015 03:24
@ilanbiala ilanbiala modified the milestones: 0.4.1, 0.4.x Aug 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants