JSFiddle - React, Tailwind, and code Playground

by Minko Gechev

HTML

<div ng-app="app" ng-controller="MainCtrl">
    <input type="text" ng-model="data" />
    <dir attr="data"></dir>
</div>

JavaScript

window.app = angular.module('app', [])
.controller('MainCtrl', function ($scope) {
    $scope.data = 'Aaa';
})
.directive('dir', function () {
    return {
        restrict: 'E',
        scope: {
            attr: '='
        },
        template: '<input type="text" ng-model="attr" />'
    };
});