JSFiddle - React, Tailwind, and code Playground

by mrajcok

HTML

<p><em>Check the console</em></p>
<div ng-app="myApp">
    <div ng-form="myForm">
        <my-input name='Email' type='email' label='Email Address' placeholder="Enter email" ng-model='model.email' required='false'></my-input>
    </div>
</div>

JavaScript

var app = angular.module('myApp', []);

app.directive('myInput', function() {
    return {
        restrict: 'E',
        require: '^form',
        replace: true,
        template: '<input>',
        link: function(scope, element, attrs, formCtrl) {
            console.log(formCtrl);
        }
    };
});