JSFiddle - React, Tailwind, and code Playground
by ashraf_sabry_m
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.js"></script>
<div>
<hymn template-url="contentUrl"><hymn>
d
</div>
JavaScript
angular.module("app", []).directive('hymn', function() {
return {
restrict: 'E',
link: function(scope, element, attrs) {
// some ode
},
templateUrl: function(elem,attrs) {
console.log(attrs.templateUrl);
alert(attrs.templateUrl);
return attrs.templateUrl || 'some/path/default.html'
}
}
});