JSFiddle - React, Tailwind, and code Playground

by Steve Ayers

HTML

<div ng-app="MyApp">
    <div ng-controller="MyCtrl as myCtrl">
        
        <text-field val="myCtrl.value"></text-field>
        
        {{myCtrl.value}}
    </div>
</div>

JavaScript

angular.module("MyApp", []).controller("MyCtrl", function () {
    
    this.value = "InitialValue";
    
    
}).directive("textField", function () {
    
    return {
        restrict : "E",
        template : "<input type='text' ng-model='val'/>",
        scope : {
            val : "="
        }
    };
    
});