로딩
요청 처리 중입니다...

Angular.js Filters 2

 Angular.js Filters 2

조건 for문 돌리기

  • {{x | Format}} var app = angular.module('App', []); app.filter('Format', function() { return function(x) { var i, c, txt = ""; for (i = 0; i < x.length; i++) { c = x[i]; if (i % 3 == 0) { c = c.toUpperCase(); } txt += c; } return txt; }; }); app.controller('Ctrl', function($scope) { $scope.names = ['jaki', 'JAKI', 'Golila', 'dog', 'TIGHER', 'RABBIT', 'bee', 'CAT', 'TUrtle']; }); ...

원문 링크 : Angular.js Filters 2