I wrote a simple Tab application using jQuery and Angular JS and sometimes after Angular JS renders html my jQuery code is not executed. I am thinking of converting this jQuery code to Angular JS directive.
Here is the link for my code snippet and output
http://jsbin.com/iDAwAso/1/edit?html,output
$(function(){
$('ul.tabs li:first').addClass('active');
$('.block article').hide();
$('.block article:first').show();
$('ul.tabs li').on('click',function(){
$('ul.tabs li').removeClass('active');
$(this).addClass('active');
$('.block article').hide();
var activeTab = $(this).find('a').attr('href');
$(activeTab).show();
return false;
});
});
Can someone help me how to convert this to angular directive?