tbfe/generator-mis

View on GitHub
app/templates/static/project/filters/_filter.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * @author <%= author %>
 * @date <%= date %>
 */

angular.module('<%= projectName %>').filter('truncate', [
    /**
     *truncate text for better display
     */
    function() {
        return function(text, limit) {
            return text.length > limit ? (text.substr(0, limit - 1) + '...') : text;
        };
    }
]).filter('isMembership', [
    /**
     * transform variable to text for better display
     */
    function() {
        return function(input) {
            return input ? '是' : '否';
        };
    }
]);