AngularJs directive naming conventions

前端 未结 2 1194
半阙折子戏
半阙折子戏 2020-12-05 19:23

When angularJs directive is defined, we have to name it in form of \'camelCase\' syntax but when we use it, we have to name it in form of \'camel-case\'. Question is why thi

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 20:08

    Directives must have camel case names (for instance, fooBarDirective) because AngularJS converts camel case directive names to hyphen case .For instance

    
    

    or

    < ...  foo-bar-directive>
    

    for use in HTML(which is case insensitive).

提交回复
热议问题