AngularJS Reference Manual

AngularJS Directives

Directive Description
ng-app Define the root element of the application.
ng-bind Bind the content of the HTML element to the application data.
ng-bind-html Bind the innerHTML of the HTML element to the application data, and remove dangerous code from the HTML string.
ng-bind-template Specify that the text content should be replaced with a template.
ng-blur Specify the behavior of the blur event.
ng-change Specify the expression to be calculated when the user changes the content.
ng-checked Specify whether the element is selected.
ng-class Specify the CSS class on the HTML element.
ng-class-even Same as ng-class, but only effective on even rows.
ng-class-odd Same as ng-class, but only effective on odd rows.
ng-click Specify the expression to be calculated when the element is clicked.
ng-cloak Prevent flickering when loading the application.
ng-controller Define the controller object of the application.
ng-copy Specify the behavior on the copy event.
ng-csp Change the content security policy.
ng-cut Specify the behavior on the cut event.
ng-dblclick Specify the behavior on the double-click event.
ng-disabled Specify whether the element is disabled.
ng-focus Specify the behavior on the focus event.
ng-form Specify the HTML form from which the controls are inherited.
ng-hide Hide or display the HTML element.
ng-href Specify the url of the <a> element.
ng-if Remove the HTML element if the condition is false.
ng-include Include HTML in the application.
ng-init Define the initial value of the application.
ng-jq Specify that the application must use libraries such as jQuery.
ng-keydown Specify the behavior on the keydown event.
ng-keypress Specify the behavior on the keypress event.
ng-keyup Specify the behavior on the keyup event.
ng-list Convert text to a list (array).
ng-maxlength Specify the maximum number of characters allowed in the input field.
ng-minlength Specify the minimum number of characters allowed in the input field.
ng-model Bind the value of the HTML control to the application data.
ng-model-options Specify how to complete the update in the model.
ng-mousedown Specify the behavior on the mousedown event.
ng-mouseenter Specify the behavior on the mouseenter event.
ng-mouseleave Specify the behavior on the mouseleave event.
ng-mousemove Specify the behavior on the mousemove event.
ng-mouseover Specify the behavior on the mouseover event.
ng-mouseup Specify the behavior on the mouseup event.
ng-non-bindable Specify that data binding cannot occur in this element or its child elements.
ng-open Specify the open attribute of the element.
ng-options Specify the <options> in the <select> list.
ng-paste Specify the behavior on the paste event.
ng-pluralize Specify the message displayed according to the en-us localization rules.
ng-readonly Specify the readonly attribute of the element.
ng-repeat Define a template for each data in the collection.
ng-required Specify the required attribute of an element.
ng-selected Specify the selected attribute of an element.
ng-show Show or hide an HTML element.
ng-src Specify the src attribute of the <img> element.
ng-srcset Specify the srcset attribute of the <img> element.
ng-style Specify the style attribute of an element.
ng-submit Specify the expression to be executed on the onsubmit event.
ng-switch Specify the condition for displaying/hiding child elements.
ng-transclude Specify the point where the embedded element is inserted.
ng-value Specify the value of an input element.

AngularJS Directives on HTML Elements

AngularJS has modified the default behavior of some HTML elements.

Element Description
a AngularJS has modified the default behavior of the <a> element.
form AngularJS has modified the default behavior of the <form> element.
input AngularJS has modified the default behavior of the <input> element.
script AngularJS has modified the default behavior of the <script> element.
select AngularJS has modified the default behavior of the <select> element.
textarea AngularJS has modified the default behavior of the <textarea> element.

AngularJS Filters

Filters Description
currency Format a number to currency format.
date Format a date to a specified format.
filter Select a subset of items from an array.
json Format an object to a JSON string.
limitTo Limit an array or string to a specified number of elements/characters.
lowercase Format string to lowercase.
number Format number to string.
orderBy Sort arrays by expression.
uppercase Format string to uppercase.

See also:

Tutorial:Angular Filters.

AngularJS Validation Properties

  • $dirty
  • $invalid
  • $error

See also:

Tutorial:Angular Validation.

AngularJS Global API

Conversion

API Description
angular.lowercase() Convert string to lowercase.
angular.uppercase() Convert string to uppercase.
angular.copy() Create a deep copy of an object or array.
angular.forEach() Execute a function for each element in an object or array.

Comparison

API Description
angular.isArray() Returns true if the reference is an array.
angular.isDate() Returns true if the reference is a date.
angular.isDefined() Returns true if the reference is defined.
angular.isElement() Returns true if the reference is a DOM element.
angular.isFunction() Returns true if the reference is a function.
angular.isNumber() Returns true if the reference is a number.
angular.isObject() Returns true if the reference is an object.
angular.isString() Returns true if the reference is a string.
angular.isUndefined() Returns true if the reference is undefined.
angular.equals() Returns true if two references are equal.

JSON

API Description
angular.fromJson() Receive a JSON string and return a JavaScript object.
angular.toJson() Receive a JavaScript object and return a JSON string.

Basic

API Description
angular.bootstrap() Manually start AngularJS.
angular.element() Wrap HTML elements as jQuery elements.
angular.module() Create, register, or retrieve AngularJS modules.

See also:

Tutorial:Angular API.