CJSCommonPlatform / govuk_single_page_pdk

Single Page Platform Development Kit
http://cjscommonplatform.github.io/govuk_single_page_pdk/
13 stars 20 forks source link

Prefix component attributes with "data-" in usage examples #117

Open radoslawn-kainos opened 7 years ago

radoslawn-kainos commented 7 years ago

Otherwise browsers might treat some attributes (e.g. "title") specially.

To see it in action, go to gov-personal-details component example, Angular Markup tab, and hover the mouse over the rendered component. On Chrome, a tooltip appears with "$ctrl.title" in it.

To avoid such surprises, it would probably be best practice to add "data-" prefix when using any custom attribute (even on custom elements).