How Angular knows that element
<app-info> refers to the
camelCase, in plain PHP we usually use
snake_case and in HTML
dash-case (also called
train-case) is recommended. Angular apps are written mostly in JS, but with the use of custom HTML elements and attributes. So at the level of framework design, it was kind of problematic to select one, consistent naming convention.
This is how AngularJS documentation describes the normalization process:
The normalization process is as follows:
data-from the front of the element/attributes.
- Convert the
_-delimited name to
That’s why element
app-info refers to the directive