JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app="app">
    Title is: <span my-directive data-title="Test title">{{ title }}</span>
</div>

JavaScript

angular.module('app', [])
    .directive('myDirective', [function() {
        return {
            restrict: 'A',
            scope: true,
            link: function($scope, $element, attrs) {
                $scope.title = attrs.title;
                alert($scope.title);   
            }
        }
    }])
;