JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<div ng-app="myApp">
<my-dir mytext="Hello"></my-dir>
</div>
JavaScript
angular.module('myApp', [])
.directive('myDir', MyDirective);
function MyDirective() {
return {
restrict: 'E',
scope: {
mytext : '@'
},
template: '<span>{{mytext}}</span>',
link: function(scope, elem, attr) {
console.log(Date.now(), elem.text());
setTimeout(function() {
console.log(Date.now(), elem.text());
}, 0);
}
}
}