JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app="demo" ng-init="" ng-controller="Demo">
    <form name="myForm" ng-submit="onSubmit()">
    <div lowercase model="data"></div>
    Valid? {{myForm.number.$valid}}
    <input type="submit" value="submit"/>
    </form>
</div>

JavaScript

var module = angular.module("demo", []);

module.directive('lowercase', function() {
    return {
        restrict: 'A',
        scope:{
            data:'=model',
            name:'@ngName'
        },
        replace: true,
        template: '<input class="something" ng-pattern="/^\\d*$/" name="number" ng-model="data" type="text">',
    };
});

module.controller('Demo', Demo);

function Demo($scope) {
    $scope.data = 'Some Value';
}