How do tags created with directives get their names?


I don't understand how the HTML elements get their names. In the exercise Im currently doing the directive is written inside appInfo.js like such:

app.directive('appInfo', function( ){...

And the HTML element created is named "< app-info >".... ¿? How does it get this name?


I wondered this too and found out that when the directive uses camelCase, each capital letter represents a dash which is converted behind the scenes.

"The $compile converts from camelCase to dash-separated behind the scenes. So, make sure you use the names correctly otherwise it won't work." -



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.