AngularJS Reference Manual
AngularJS Directives
AngularJS directives used in this tutorial:
| Directive | Description |
|---|---|
| ng-app | Defines the root element of an application. |
| ng-bind | Binds HTML elements to application data |
| ng-bind-html | Binds the innerHTML of an HTML element to application data, and removes dangerous characters from the HTML string. |
| ng-bind-template | Specifies the text content to be replaced by a template. |
| ng-blur | Specifies the behavior on the blur event. |
| ng-change | Specifies the expression to execute when content changes. |
| ng-checked | Specifies whether an element is selected. |
| ng-class | Specifies the CSS class used by an HTML element. |
| ng-class-even | Similar to ng-class, but only works on even rows. |
| ng-class-odd | Similar to ng-class, but only works on odd rows. |
| ng-click | Defines the behavior when an element is clicked. |
| ng-cloak | Prevents flickering while the application is loading. |
| ng-controller | Defines the controller object for the application. |
| ng-copy | Specifies the behavior on the copy event. |
| ng-csp | Modifies the content security policy. |
| ng-cut | Specifies the behavior on the cut event. |
| ng-dblclick | Specifies the behavior on the double-click event. |
| ng-disabled | Specifies whether an element is disabled. |
| ng-focus | Specifies the behavior on the focus event. |
| ng-form | Specifies an HTML form inherits the controller form. |
| ng-hide | Hides or shows HTML elements. |
| ng-href | Specifies a link for the <a> element. |
| ng-if | Removes an HTML element if the condition is false. |
| ng-include | Includes an HTML file in the application. |
| ng-init | Defines the initial values of an application. |
| ng-jq | Defines the libraries that the application must use, such as jQuery. |
| ng-keydown | Specifies the behavior when a key is pressed. |
| ng-keypress | Specifies the behavior when a key is pressed. |
| ng-keyup | Specifies the behavior when a key is released. |
| ng-list | Converts text to a list (array). |
| ng-model | Binds the value of HTML controls to application data. |
| ng-model-options | Specifies how to update the model. |
| ng-mousedown | Specifies the behavior when a mouse button is pressed. |
| ng-mouseenter | Specifies the behavior when the mouse pointer enters an element. |
| ng-mouseleave | Specifies the behavior when the mouse pointer leaves an element. |
| ng-mousemove | Specifies the behavior when the mouse pointer moves inside the specified element. |
| ng-mouseover | Specifies the behavior when the mouse pointer is over an element. |
| ng-mouseup | Specifies the behavior when the mouse button is released over an element. |
| ng-non-bindable | Specifies that the element or its child elements cannot be bound to data. |
| ng-open | Specifies the open attribute of an element. |
| ng-options | Specifies <options> in a <select> list. |
| ng-paste | Specifies the behavior on the paste event. |
| ng-pluralize | Displays information according to localization rules. |
| ng-readonly | Specifies the readonly attribute of an element. |
| ng-repeat | Defines a template for each item in a collection. |
| ng-selected | Specifies the selected attribute of an element. |
| ng-show | Shows or hides HTML elements. |
| ng-src | Specifies the src attribute of an <img> element. |
| ng-srcset | Specifies the srcset attribute of an <img> element. |
| ng-style | Specifies the style attribute of an element. |
| ng-submit | Specifies the expression to execute when the onsubmit event occurs. |
| ng-switch | Specifies the condition for showing or hiding child elements. |
| ng-transclude | Specifies the target position for filling. |
| ng-value | Specifies the value of an input element. |
Filter ParsingAngularJS Filters。
AngularJS Events
AngularJS supports the following events:
- ng-click
- ng-dbl-click
- ng-mousedown
- ng-mouseenter
- ng-mouseleave
- ng-mousemove
- ng-keydown
- ng-keyup
- ng-keypress
- ng-change
Event Parsing:Angular Events。
AngularJS Validation Attributes
- $dirty
- $invalid
- $error
Validation Parsing:Angular Validation。
AngularJS Global API
Conversion
| API | Description |
|---|---|
| angular.lowercase() | Converts a string to lowercase |
| angular.uppercase() | Converts a string to uppercase |
| angular.copy() | Deep copies an array or object |
| angular.forEach() | Iteration function for objects or arrays |
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 objects are equal |
JSON
| API | Description |
|---|---|
| angular.fromJson() | Deserialize a JSON string |
| angular.toJson() | Serialize a JSON string |
Basics
| API | Description |
|---|---|
| angular.bootstrap() | Manually start AngularJS |
| angular.element() | Wrap a portion of a DOM element or an HTML string, and treat it as a jQuery element. |
| angular.module() | Create, register, or retrieve an AngularJS module |
Global API reference:Angular API。
Other extensions