JSFiddle - React, Tailwind, and code Playground

by egamonal

HTML

<div ng-app="sodemo">
    <demo></demo>

    <!-- version 1, without controller -->
    <div data-ng-element-ready="console.log('COMPILED!')"  </div>

</div>

JavaScript

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

app.directive('demo', function() {
    return {
        restrict: 'E',
        template: '<span>This is a demo</span>'
    }
});

/* 
asked in http://stackoverflow.com/questions/23719622/why-does-the-link-function-of-my-directive-never-get-called

version 1 
*/
app.directive('ngElementReady', ['$window', function($window) {
    return {
        restrict: "A",
        link: function($scope, $element, $attributes) {
            console.log("Reached the link fn", $attributes);
            $window.eval($attributes.ngElementReady);
        }
    };
}]);