ããªããæ¬é£è¼ã§ã¯AngularJSãã®ãã®ã«é¢ãã¦ã¯è§£èª¬ãã¾ããã®ã§ãå°éæ¸ã¨ãã¦ãAngularJSã¢ããªã±ã¼ã·ã§ã³ããã°ã©ãã³ã°ããå§å¦¹é£è¼ãAngularJSã§ã¯ãããJavaScriptãã¬ã¼ã ã¯ã¼ã¯éçºã¹ã¿ã¤ã«ããªã©ãä½µãã¦åç §ãã¦ãã ããã
ã¯ããã«
ããã£ã«ã¿ã¼ã¨ã¯ãä¸ããããå¤æ°ï¼å¼ï¼ã®å¤ãå å·¥ããããã®ä»çµã¿ã§ãã主ã«ãã³ãã¬ã¼ãï¼Angularå¼ï¼ããå©ç¨ãã¾ãã以ä¸ã«ãAngularJSæ¨æºã§ç¨æããã¦ãããã£ã«ã¿ã¼ãã¾ã¨ãã¦ããã¾ãï¼æ³¨1ï¼ã
åé¡ | ãã£ã«ã¿ã¼ | æ¦è¦ |
---|---|---|
æåå | lowercase | 大æåâå°æåã®å¤æ |
uppercase | å°æåâ大æåã®å¤æ | |
json | ãªãã¸ã§ã¯ããJSONæååã«å¤æ | |
linky | URLï¼ã¡ã¼ã«ã¢ãã¬ã¹ããªã³ã¯ã«æ´å½¢ | |
é å | orderBy | é åãæå®ã®ãã¼ã§ä¸¦ã¹æ¿ã |
filter | é åãæå®ã®æ¡ä»¶ã§æ¤ç´¢ | |
limitTo | é åã®mï½n件ç®ãæ½åº | |
æ°å¤ï¼æ¥ä» | number | æ°å¤ã«æ¡åºåãæåãä»ä¸ãå°æ°ç¹ä»¥ä¸ã®ä¸¸ã |
currency | é貨形å¼ã«æ´å½¢ | |
date | æ¥ä»ãæ´å½¢ |
注1
ãåã ã®ãã£ã«ã¿ã¼ã®ç¨æ³ã«ã¤ãã¦ã¯ããAngularJS TIPSãã®ãããªè¨äºãåç §ãã¦ãã ããã
ãããåºæ¬çãªç¨éã«éå®ããã¦ãããããããéåã¨å°ãªããªãã¨ããã®ã第ä¸å°è±¡ããããã¾ããããã¡ãããèªä½ã®ãã£ã«ã¿ã¼ãä½æããã®ã¯ããã»ã©é£ãããã¨ã§ã¯ããã¾ãããããããããããªæ©è½ããã¡ãã¡èªä½ããã®ã¯è»è¼ªã®åçºæãªã®ã§ã¯ãã¨æãã人ã¯å¤ãã®ã§ã¯ãªãã§ããããã
ããã®ãããªæ¹ã¯ãæ¬ç¨¿ã§ç´¹ä»ããAngular Filterã®å°å ¥ãæ¤è¨ãã¦ã¿ã¦ã¯ã©ãã§ããããAngular Filterã¯ãååã®ã¨ãããAngularJSã¢ããªã§å©ç¨ã§ãããã£ã«ã¿ã¼ã©ã¤ãã©ãªãã³ã¬ã¯ã·ã§ã³ï¼é åï¼ãæååãæ°å¤æ¼ç®ãå¤å®é¢é£ã®ãã£ã«ã¿ã¼ã80種é¡è¿ããæä¾ããã¦ãã¾ããAngularJSæ¨æºã®ãã£ã«ã¿ã¼ã«ä¸æºãæããããã¾ãã¯Angular Filterã«ç®çã®æ©è½ããªããã確èªãã¦ã¿ãã®ãè¯ãã®ã§ã¯ãªãã§ãããããèªä½ã決æããã®ã¯ãããããã§ãé ãã¯ããã¾ããï¼
対象èªè
- AngularJSã«ã¤ãã¦åºæ¬çãªæ¦å¿µãç解ãã¦ããæ¹
- AngularJSã§SPAï¼Single Page Applicationï¼ãå®è£ ãããã¨èãã¦ããæ¹
- AngularJSæ¨æºã®ãã£ã«ã¿ã¼ã§ã¯ä¸è¶³ã ã¨æãã¦ããæ¹
æ¤è¨¼ç°å¢
ããã®è¨äºã§ã¯ã以ä¸ã®ç°å¢ã§ãµã³ãã«ã®åä½ã確èªãã¦ãã¾ãã
- AngularJS 1.4.6
- Angular Filter 0.5.5
- Chrome 45
- Firefox 40
- Internet Explorer 11
ãAngular Filterã¯ãBowerãå©ç¨ãããã¨ã§ã以ä¸ã®ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ããBowerã«é¢ãã詳細ã¯ãå¥ç¨¿ãWebéçºã©ã¤ãã©ãªãèªåçã«å ¥æã§ããããã±ã¼ã¸ç®¡çãã¼ã«Bowerããåç §ãã¦ãã ããã
> bower install --save angular-filter
ãAngular Filterã®æ©è½ã¯ã大ããStringï¼æååæä½ï¼ãMathï¼æ°å¤æ¼ç®ï¼ãBooleanï¼å¤å®ï¼ãCollectionï¼é åæä½ï¼ã«åé¡ã§ãã¾ããå¤å®ã«ã¤ãã¦ã¯ããã¼ã¿åãå¤ã®å¤§å°ãå¤å®ããã ãã®ãè¦ãç®ãã®ã¾ã¾ãªãã£ã«ã¿ã¼ãªã®ã§ã以ä¸ã§ã¯ããããé¤ãStringï¼Mathï¼Collectionã«ã¤ãã¦ã代表çãªãã®ã解説ãã¦ããã¾ãã