AngularJS Reference Manual



AngularJS directives

AngularJS directives used in this tutorial:

##ng-mouseenterSpecifies the behavior of the mouse pointer when the mouse button is pressed Behavior when passing the elementng-mouseleaveSpecifies the behavior when the mouse pointer leaves the elementng-mousemoveSpecifies the behavior of the mouse pointer when moving within the specified elementng-mouseoverSpecifies the behavior of the mouse pointer when it is over the elementng-mouseupSpecifies the behavior when the mouse button is released on an elementng-non-bindableSpecify that elements or sub-elements cannot be bound to datang-openSpecify the open attribute of the element
Directive Description
ng-app Defines the root element of the application.
ng-bindBind HTML elements to application data
ng-bind-htmlBind the innerHTML of the HTML element to the application data and remove dangerous characters from the HTML string
ng-bind-templateSpecifies that template replacement should be used The text content
ng-blurSpecifies the behavior of the blur event
ng-change Specifies an expression to be executed when the content changes
ng-checkedSpecifies whether the element is checked
ng- classSpecify the CSS class used by HTML elements
ng-class-evenSimilar to ng-class, but only works on even lines
ng-class-oddSimilar to ng-class, but only works on odd rows
ng-clickDefine the behavior when an element is clicked
ng-cloakPrevent the app from flickering when it is about to load
ng-controllerDefine the controller object of the application
ng-copySpecify the behavior of the copy event
ng-cspModify content security policy
ng-cutSpecify the behavior of cut events
ng-dblclickSpecifies the behavior of a double-click event
ng-disabledSpecifies whether an element is Disable
ng-focusSpecify the behavior of focus events
ng-formSpecify HTML Form inheritance controller form
ng-hideHide or show HTML elements
ng-hrefSpecify a link for the <a> element
ng-ifRemove the HTML element if the condition is false
ng-includeInclude HTML files in the application
ng-initDefine the initialization values ​​​​of the application
ng-jqDefine the library that the application must use, such as: jQuery
ng-keydownSpecifies that the key is pressed The behavior of the event
ng-keypressSpecifies the behavior of the key press event
ng-keyupSpecify the behavior of the key release event
ng-listConvert text to a list (array)
ng-modelBind the value of the HTML controller to the application data
ng-model-optionsSpecify how to update the model
ng-mousedownSpecifies the behavior when the mouse button is pressed
ng-optionsSpecify <options> in the <select> list
ng-pasteSpecify paste Behavior of events
ng-pluralizeDisplay information according to localization rules
ng-readonlySpecify the readonly attribute of the element
ng-repeatDefine the template for each item of data in the collection
ng-selected Specify the selected attribute of the element
ng-showShow or hide the HTML element
ng -srcSpecify the src attribute of the <img> element
ng-srcsetSpecify the srcset attribute of the <img> element
ng-styleSpecifies the style attribute of the element
ng-submitSpecifies that the onsubmit event will be executed when the event occurs The expression
ng-switch specifies the conditions for showing or hiding child elements
ng-transclude Specify the target position of filling
ng-valueSpecify the value of the input element

Filter The processor parses AngularJs 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 analysis: Angular event.


AngularJS Validation Properties

  • $dirty

  • $invalid

  • $error

Verification analysis: Angular verification.


AngularJS Global API

Conversion

##APIDescriptionangular.lowercase()Convert the string to lowercaseangular.uppercase()Convert the string to uppercase angular.copy()Array or object deep copyangular.forEach()Iteration function of object or array

Compare

##angular.isArray() Returns true if the reference is an arrayangular.isDate()Returns true if the reference is a dateangular .isDefined()Returns true if the reference is definedangular.isElement()Returns true if the reference is a DOM elementangular.isFunction()Returns true if the referenced function is angular.isNumber()If the reference is a number, return trueangular.isObject()If the reference is an object, return true angular.isString()Returns true if the reference is a stringangular.isUndefined()Returns true if the reference is undefinedangular.equals()Returns true if the two objects are equal
APIDescription
JSON

APIDescriptionangular.fromJSON()Deserialize JSON stringangular.toJSON() Serialize JSON string
Basics

APIDescriptionangular.bootstrap()Manually start AngularJSangular.element()Wraps a part of the DOM element or HTML string and processes it as a jQuery element. angular.module()Create, register or retrieve an AngularJS module
Global API parsing: Angular API.