ANGULARJS Filter (currency conversion, case, word limit, date) __js

Source: Internet
Author: User
Tags lowercase
<div ng-app= "module" ng-controller= "Ctrl" Style= "Text-align:center" > <!--original value--> {price}} <br> <!--Use the currency filter--> {price|currency}} <br> <!--Use the currency filter with a fixed prefix--> {{price|currency: ' ¥ '} <br> <!--Use the currency filter with a fixed prefix and take only 1 decimal--> {{price|currency: ' ¥ ': 1}} <br> <!--use number over Filter and take only 2 decimal--> {{price|number:2}}<br> <!--original value--> {{name}} <br> <!--use lowercase to lowercase-- > {{name|lowercase}} <br> <!--use uppercase to capitalize--> {{name|uppercase}} <br> <!--original Value-
    > {{Data}} <br> <!--limit Display 2 characters--> {data|limitto:2}} <br> <!--limit Displays the first 4 words starting from 0 subscript--> {{data|limitto:4:0}} <br> <!--restricts the display of the first 4 characters from the 2 subscript--> {Data|limitto:4:2}} <br> <!--the original value timestamp- -> {Time}} <br> <!--date--> {time|date: ' yyyy mm monthly dd Day HH when mm minutes ss seconds '} <br> </div> &L t;script> var m = Angular.module (' module ', []);
        M.controller (' Ctrl ', [' $scope ', function ($scope) {//* value, Currency filter/$scope. price=1234.567;
        /* Case Filter/$scope. name= ' BaiDu ';
        * * Word limit filter/$scope. Data= ' Welcome to browse cool blog on the way;
    /* Date Filter/$scope. Time=new date (). GetTime ();
}]); </script>

Run Result:

Related Article

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.