JSFiddle - React, Tailwind, and code Playground
by phaas
HTML
<script src="https://code.angularjs.org/1.2.9/angular.js"></script>
<section ng-app="app" ng-controller="MyCtrl">
<div test-directive="foo"></div>
</section>
JavaScript
var module = angular.module('app', []);
module.controller('MyCtrl', ['$scope', function ($scope) {
$scope.foo = [1, 2, 3, 4];
}]);
module.directive('testDirective', [function () {
return {
template: 'Local Value: {{localValue|json}}',
scope: {
'localValue': '=testDirective'
},
controller: ['$scope', function ($scope) {
console.log($scope.localValue);
}]
}
}]);