JSFiddle - React, Tailwind, and code Playground

by etcoding

HTML

<input type="input" ng-model="filteredInput">
<span>{{filteredInput | minLen:3:'make it longer'}}</span>

JavaScript

angular.module('filters', []).filter('minLen', function() {
    return function(input, minLen, message) {
        minLen = minLen || 0;
        message = message || 'Too short';

        if (typeof(input) === 'undefined' || input.length < minLen) return message;
        return input;
    }
});
angular.bootstrap(document, ['filters']);