Latest web development tutorials

AngularJS Reference Manual

AngularJS directives

This tutorial uses the AngularJS directives:

instruction description
ng-app Defines the root element of the application.
ng-bind Bind HTML elements to the application data
ng-bind-html HTML elements innerHTML bind to application data, and remove HTML string dangerous characters
ng-bind-template To use a template to replace the provisions of the text
ng-blur Behavior prescribed blur event
ng-change Expression specified when content changes to be executed
ng-checked Whether the element is selected provisions
ng-class Specifies the CSS class to use HTML elements
ng-class-even Similar ng-class, but only works in even rows
ng-class-odd Similar ng-class, but it works only in odd-numbered rows
ng-click Defined behavior when clicked element
ng-cloak Prevent flicker when the application was about to be loaded
ng-controller Controller object definition Application
ng-copy Behavior provisions copy events
ng-csp Content security policy
ng-cut Shear behavior specified events
ng-dblclick Double-click the behavior specified events
ng-disabled It specifies whether an element is disabled
ng-focus Behavior provisions focus event
ng-form Specifies the HTML form inherited form controller
ng-hide Hide or display HTML elements
ng-href Element specifies a link to the <a>
ng-if If the condition is false to remove HTML elements
ng-include It contains the HTML file in the application
ng-init Initialization value is defined applications
ng-jq You must be used to define the application libraries, such as: jQuery
ng-keydown Press the key event of the provisions of behavior
ng-keypress Press the key event of the provisions of behavior
ng-keyup Release the key provisions of the behavior of the event
ng-list Convert text to a list (array)
ng-model The bind HTML data to the application controller
ng-model-options How to update the model provisions
ng-mousedown Behavior provisions mouse button is pressed
ng-mouseenter Acts through provisions of the mouse pointer when the elements
ng-mouseleave Provisions of the mouse pointer leaves the element behavior when
ng-mousemove Provisions of the mouse pointer moves behavior when a specified element
ng-mouseover Provisions of the mouse pointer is positioned over the behavior of elements when
ng-mouseup When the provisions on the element release the mouse button behavior
ng-non-bindable Regulations or children can not be bound data
ng-open open attribute specified element
ng-options Specified <options> in <select> list
ng-paste Behavior provisions to paste the event
ng-pluralize Display information according to the rules of localization
ng-readonly readonly attribute specified element
ng-repeat Each template defines the collection of data
ng-selected selected attribute specified element
ng-show Show or hide HTML elements
ng-src src attribute specifies the <img> element
ng-srcset srcset attribute specifies the <img> element
ng-style style attribute specified element
ng-submit Expression onsubmit event occurs when the provisions of
ng-switch Show or hide the child elements specified conditions
ng-transclude Predetermined target position filled
ng-value Predetermined value input element

Filter resolve AngularJs filter .


AngularJS event

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 resolve: Angular event .


AngularJS validation properties

  • $ Dirty
  • $ Invalid
  • $ Error

Analytical verification: Angular verification .


AngularJS global API

Change

API description
angular.lowercase () Converts a string to lowercase
angular.uppercase () To convert a string to uppercase
angular.copy () Deep copy an array or object
angular.forEach () Iterated function object or an array

Compare

API description
angular.isArray () If the reference is an array return true
angular.isDate () If the reference is a true return date
angular.isDefined () If the reference has defined return true
angular.isElement () If the reference is a DOM element returns true
angular.isFunction () If the reference is a function returns true
angular.isNumber () If the reference is a digital return true
angular.isObject () If the reference is an object returns true
angular.isString () If the reference is a string return true
angular.isUndefined () Returns true if the referenced undefined
angular.equals () Returns true if the two objects are equal

JSON

API description
angular.fromJson () Anti? Serialized JSON string
angular.toJson () ? Serialized JSON string

basis

API description
angular.bootstrap () Manually start AngularJS
angular.element () Wrapped part of the DOM element or HTML string, put it as a jQuery element to deal with.
angular.module () Creation, registration, or retrieve AngularJS module

Global API parsing: Angular API .