JSFiddle - React, Tailwind, and code Playground

by yahyaKACEM

HTML

<div ng-app="myApp">
    <div ng-controller="ctrl1">
        <mydiv>First div</mydiv>
    </div>
</div>

JavaScript

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

app.controller('ctrl1', function(){

})

app.directive('mydiv', function(){
    return {
        restrict: 'E',
        controller: function($scope){
            $scope.things = [1, 2, 3, 4, 5]
        },
        template: '<div divtwo ng-repeat="stuff in things">{{stuff}} template item</div>',
        link: function(scope, elem, attr) {
            console.log("link function in 1st directive");
        }
    }
   
})

app.directive('divtwo', function(){
    return {
        restrict: 'A',
        link: function(scope, elem, attr) {
            console.log("I want this to fire!");
    }
    }
})