Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Angular Directives Reply To: Angular Directives

#200222
Alen
Participant

am I completely misunderstanding this

Nope, you got it — it’s called attribute normalization.

So Angular will strip these and convert them to camelCase.

  • app-info, becomes appInfo
  • x-app-info, becomes appInfo
  • data-app-info, becomes appInfo

You can also use:

  • app:info or app_info, all of these will be converted or normalized

You just need to decide what convention you wish to use, Angular doesn’t make any assumptions, it tries to make everyone happy.

See Angular Documentation (scroll to Normalization)