Code Download: Https://files.cnblogs.com/files/xiandedanteng/angularJSFilter.rar
Display effect:
Page code:
<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTMLNg-app= "Notesapp"> <Head> <title>New Document</title> <style>. Bluetext{Color:Blue; } </style> <MetaCharSet= "GBK"> <Scriptsrc= "Angular1.4.6.min.js"></Script> </Head> <BodyNg-controller= "Mainctrl as CTRL"> <P>Hi,i am<spanclass= "Bluetext"Ng-bind= "Ctrl.user.name|uppercase"></span>. Everyone like to call me<spanclass= "Bluetext"Ng-bind= "Ctrl.user.shortname|lowercase"></span></P> <P>I have<spanclass= "Bluetext"Ng-bind= "Ctrl.user.fans|number"></span>Fans around the world.</P> <P>I can bring you<spanclass= "Bluetext"Ng-bind= "Ctrl.user.money|currency"></span> </P> <P>Now it's<spanclass= "Bluetext"Ng-bind= "ctrl.user.time|date: ' Medium '"></span>, date is<spanclass= "Bluetext"Ng-bind= "Ctrl.user.time|date"></span>.</P> </Body></HTML><Scripttype= "Text/javascript"><!--Angular.module ('Notesapp', []). Controller ('Mainctrl',[function(){ var Self= This; Self.user={name:"Angular JavaScript", ShortName:"Agljs", fans:123456789, Money:9087564312}; Self.user.time=NewDate (). GetTime (); }]);// -</Script>
Examples of filters for Angularjs