JSFiddle - React, Tailwind, and code Playground

by thelgevold

HTML

<html ng-app="app">
    <body>
        <div ng-view>
            <div do-it>
                // ....
            </div>
        </div>
    </body>
</html>

JavaScript

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

directives.directive('doIt', ['$window', function($window) {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            console.log('Inside link()');
            // Do stuff with $window
        }
    };
}]);