AngularJs[自定义过滤器]

来源:互联网 发布:淘宝运营绩效考核方案 编辑:程序博客网 时间:2024/05/29 19:09
var myApp = angular.module('myApp', []);myApp.filter('formatBillType', function () {            return function (input) {                var output=input;//将输入值转换为输出值           return output;            }        })


使用: 在前台中: {{model|formatBillType}}

在UI-Grid中 

 $scope.gridOptions.columnDefs=[
                    {
                        field: 'MainTableType',
                        displayName: '单据类型',
                        width: '120',
                        cellFilter: 'formatBillType'//过滤器转换单据类型
                    }]

0 0
原创粉丝点击