ANGULARJS Review-----Built-in filters and built-in services

Source: Internet
Author: User

built-in services in Angularjs (30 +):
  • $http sends HTTP requests, mainly for the implementation of asynchronous data requests, the service mainly encapsulates the XMLHttpRequest object and JSONP data access pattern to complete the remote request
  • $resource to create a restful server-side data source interaction Object
  • $location the URL address used to return the current page
  • jquery wrapper $window The window element of the browser
  • jquery wrapper $document The document element of the browser
  • $rootscope with scope access
  • $rootElement access to the root element
  • $interval provides access to Window.setinterval
  • $timeout provides access to Window.timeout
  • $cookies provide read-write access to cookies on the browser
  • $animate provide animated hooks to link to animations based on CSS and JavaScript at the same time

Built-in filters in the ANGULARJS:

  • Currency "Currency" is used to specify the currency type currency: ' ¥ ': 4-----4 represents the number of reserved decimals
  • LimitTo This filter can intercept string parameters to indicate the number of interception ( -2,2)
  • Lowercase This filter can turn letters into lowercase
  • Uppercase This filter can capitalize letters
  • Number This filter can be digitally formatted to control decimals
  • Order this filter to sort the array data
  • JSON this filter can convert data into JSON format
  • Filter this filter filters the data
  • Date formats the dates into the format you want

The Date Filter built-in support for many of the local formatting dates, it is very convenient to use, of course, can also use the Moment.js plug-in to complete, the plug-in is also very powerful!

  • {{Today | Date: ' Medium ' }} <!--12:09:02 PM--
  • {{Today | date: ' Short '} <!--8/9/1312:09pm--
  • {{Today | date: ' Fulldate '}} <!--Thursday, August,---
  • {{Today | date: ' Longdate '}} <!--August,---
  • {Today | date: ' mediumdate '}}<!--.
  • {{Today | date: ' shortdate '} <!--8/9/13--
  • {{Today | date: ' mediumtime '}}<!--12:09:02 PM--
  • {{Today | date: ' Shorttime '}} <!--12:09 PM--
  • ? Year formatting
  • Four-bit year: {{today | date: ' YYYY '}} <!--
  • Two-bit year: {{today | date: ' YY '}} <!--
  • One year: {{today | date: ' Y '}} <!--
  • ? Month formatting
  • English Month: {{today | date: ' MMMM '} <!--August--
  • Abbreviated English month: {today | date: ' MMM '} <!--
  • Number month: {{today |date: ' MM '} <!--
  • Month of the year: {{today |date: ' M '}} <!--8--
  • ? Date formatting
  • Numeric Date: {{today|date: ' DD '}} <!----
  • Day of the one month: {{today | date: ' d '}} <!--9--
  • English week: {today | date: ' EEEE '} <!--Thursday--
  • English week abbreviation: {today | date: ' EEE '} <!--Thu--
  • ? Hour formatting
  • 24-hour Digital hours: {{today|date: ' HH '}} <!--00-->
  • Hours of the day: {{today|date: ' H '}} <!--0-->
  • 12-hour Digital hours: {{today|date: ' hh '}} <!--12-->
  • Hours of the morning or afternoon: {{today|date: ' H '}} <!--12-->
  • ? Minute formatting
  • Number of minutes: {{Today | date: ' mm '} <!----
  • Minutes in one hours: {{Today | date: ' m '}} <!--9--
  • ? Number of seconds to format
  • Number of seconds: {{today | date: ' SS '}} <!--
  • Seconds in a minute: {{today | date: ' s '}} <!--2--
  • Milliseconds: {{today | date: '. SSS '}} <!--. 995--
  • ? Character formatting
  • Last Afternoon ID: {{today | date: ' A '}} <!--AM--
  • Four-bit time zone ID: {{today | date: ' Z '}} <!---0700--
  • Here are some examples of custom date formats:
  • {{Today | date: ' MMMD, y '}} <!--Aug9,---
  • {Today | date: ' eeee, D, M '}} <!--Thursday, 9, 8-->
  • {{Today | date: ' HH:MM:SS.SSS '} <!--12:09:02.995--

ANGULARJS Review-----Built-in filters and built-in services

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.