1

When i look up the API references of AngularJS, the directive uses capital Letter in the API documentation and without hyphen

for example ngApp is not like ng-app

When we code it we code it like this

<html ng-app>

<html>

Why it is done like this ? it it purposefully

2
  • 1
    possible duplicate of Name conventions in angualrjs directives Commented Sep 17, 2014 at 10:00
  • Angular normalizes an element's tag and attribute name to determine which elements match which directives. We typically refer to directives by their case-sensitive camelCase normalized name (e.g. ngModel). However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case forms, typically using dash-delimited attributes on DOM elements (e.g. ng-model). See angular docs - docs.angularjs.org/guide/directive Commented Sep 17, 2014 at 10:02

1 Answer 1

2

from the DOCS (https://docs.angularjs.org/guide/directive)

Angular normalizes an element's tag and attribute name to determine which elements match which directives. We typically refer to directives by their case-sensitive camelCase normalized name (e.g. ngModel). However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case forms, typically using dash-delimited attributes on DOM elements (e.g. ng-model).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.