JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp" >
<directive name="1"></directive>
<directive name="2"></directive>
</div>
JavaScript
angular.module('myApp', [])
.directive('directive', function () {
return {
restrict: 'E',
scope: {name: '='},
template: '{{foo.name}}',
controller: ctrl,
controllerAs: 'foo'
}
});
function ctrl($attrs) {
this.name = $attrs.name;
}