Groups
Sign in
Groups
JavaScript Templates Engine PURE
Conversations
About
Send feedback
Help
onClick event on image
3 views
Skip to first unread message
or9...@gmail.com
unread,
Aug 27, 2015, 9:44:22 AM
8/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaScript Templates Engine PURE
Hi,
I'm trying to create click events for each image.
This is my directive, any idea?
var
directive
=
{
'div': {
'doc<-docs': {
'h1': '
doc.name
',
'img.logImg@src': function() {
return getUrl(this.url);
},
'img.treeViewIcon@onclick': function() {
return alert(
this.name
);
},
}
}
};
Thanks,
Or.
Mic (BeeBole)
unread,
Aug 27, 2015, 11:45:46 AM
8/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaScript Templates Engine PURE
When you inspect the result.
Do you see something like
<img class="treeViewIcon" onclick=... />
?
Try to make an example HTML + JS in a gist, like this
https://gist.github.com/beebole/09f33882cce942943157
It is easier to find why something goes wrong.
Mic (BeeBole)
unread,
Aug 27, 2015, 2:21:15 PM
8/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaScript Templates Engine PURE
Sorry... I did not understand correctly.
You need to return a string, not a function or a call.
eg:
'img.treeViewIcon@onclick': function() {
return 'alert(' +
this.name
+ ');';
},
On Thursday, 27 August 2015 15:44:22 UTC+2, Or Moushkatel wrote:
Reply all
Reply to author
Forward
0 new messages