JSFiddle - React, Tailwind, and code Playground

by justinwyllie

HTML

<div ng-controller="MyCtrl">
    
    <div ng-bind="message"></div>
    
    <div data-test></div>
    
</div>

JavaScript

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

function MyCtrl($scope) {
    $scope.message = 'hello';
}

app.directive('test', function() {
    return {
        restrict: 'A',
        template: '<div>xxx</div>',
        replace: true,
        link: function(scope, elm, attrs) {
            alert(scope.message);
                   
        }
    };
});