Reputation: 23
Hi i create a label with link, but how to get link click listener
my code is
html:'<a href="#">My Link</a>',
listeners:{
tap : function()
{
console.log('click');
}
}
but the listener does not work .
Upvotes: 1
Views: 1740
Reputation: 38102
Give your anchor a class
and then try to use event delegation like this:
html:'<a class="link" href="#">My Link</a>',
listeners : {
element : 'element',
delegate : 'a.link',
tap : function() {
console.log('click');
}
}
Upvotes: 1