JSFiddle - React, Tailwind, and code Playground

by Yang Tyler

HTML

<div ng-app="myApp">
    <div ng-controller="testController">
        <div ng-repeat="t in testArr">
            <test-dir article="t"> <test-dir>
        </div>
    </div>
</div>

JavaScript

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

myApp.controller("testController", function($scope){
    $scope.testArr = [
        {
            name: "John",
            age: 15
        },
        {
            name: "Kevin",
            age: 20
        },
        {
            name: "Tyler",
            age: 25   
        }
    ];
});
myApp.directive("testDir", function(){
   return {
		restrict: 'E',
        template: "<div ng-bind='article.name'></div>",
		replace: true,
		scope: { article:'=' },
		link:function(scope, element, attrs){
            console.log(scope);
		}
	};
});