AngularJS (6)

Source: Internet
Author: User

One: the Angularjs event.

The 1.ng-click directive defines ANGULARJS click events.

<div ng-app= "MyApp" ng-controller= "Myctrl" >    <button ng-click= "count=count+1" > Likes </button>    

Event Methods for 2.angularJs

<div ng-app= "Mapp" ng-controller= "Mctrl" >  <input type= "button" ng-click= "Toggle ()" value= "Show/Hide" >  <div ng-show= "HHH" >      your Name: <input type= "text" ng-model= "uname" ><br>    your salutation: <input Type= "text" ng-model= "Usex" ><br>    

Two: The following list some angularjs commonly used events.

Ng-mousedown mouse button down
Ng-mouseup Mouse Press to play
Ng-mouseenter Mouse Entry
Ng-mouseleave Mouse Away
Ng-mousemove Mouse Movement
Ng-mouseover Mouse Entry

Ng-dblclick Double-click event
Ng-blur lost Focus Event
Ng-focus Get Focus
Ng-change Update Model
ng-copy Copy Ctrl + C
ng-paste Paste Ctrl + V
Ng-keydown: Keyboard pressed

Three: Angularjs filter.

AngularJS filters can be used to convert data:
Format numbers for currency format: currency
Select a subset from the array item: Filter
The formatted string is lowercase: lowercase
Arrange arrays According to an expression: ORDER by: ' Column name '
The default is from small to large sort, if you want to sort from large to small, just add the column name before the-No.
Show top several: Limitto:3
Example: <li ng-repeat= "x in Student | By: ' Uage ' | Limitto:3 ">{{x.sname}}</li>
format string to uppercase: uppercase

Instance: {{uname | uppercase}}

Four: Angularjs Services (Service)

In AngularJS, a service is a function or object that can be used in your AngularJS app. More than 30 services are built in AngularJS

$location Services.
$http Services.
$timeout Services.
$interval Services.
Create a custom service.

Turn

AngularJS (6)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.