Confusion about creating Directives


#1

When angular first introduces creating directives, it has you create an . But in the appInfo.js file, it names the directive 'appInfo'. When using the html element, will it always have you use a hyphen and seperate the words like , or should it technically be ? Thanks for answering!


#2

Hi,
As far as i read about the Angular js directives, reason behind using hyphen is for normalization. In simple words to separate the capital letter because Angularjs is case sensitive unlike html. Hence your directive appInfo gets
app-info and installApp gets install-app. Hope it clears things out bit more.

-Saju