1. 枚举过滤器
var AppFilters = angular.module(‘illCaseListApp.filters‘, []); AppFilters..filter(‘gender‘, function() { return function(input) { var array=new Array("未知的性别","男","女","未说明的性别"); if (input) { switch(input) { case 0: case 1: case 2: return array[input]; break; case 9: return array[3]; break; default: return "error"; } } } })在ng-repeat中<td>{{medicalCardResultModel.gender|gender}}</td>
时间: 2024-10-11 23:24:01