JSFiddle - React, Tailwind, and code Playground
by Yang Tyler
HTML
<script src="https://code.angularjs.org/1.2.26/angular.js"></script>
<div ng-app="MyApp">
<sampleanchortag></sampleanchortag>
</div>
JavaScript
var myApp = angular.module("MyApp", []);
myApp.directive('sampleanchortag',function(){
return{
restrict:'EA',
//replace:true,//
template:'<a href="https://www.google.com">Click Here</a>',
link:function(scope, elem, attrs){
elem.find("a").attr('href', 'https://www.gmail.com');
//elem.attr('href','https://www.gmail.com'); //works when set replace=true
}
};
});