I figured it out, ther eare 2 ways to do it :

<div (click)="myAction()"></div>
<div on-click="myAction()"></div>


and in your component:

Class({
        constructor: function() {},
        myAction: function() {
            console.log("hi world");
        }
      }


On Saturday, June 4, 2016 at 5:49:39 AM UTC-4, Sander Elias wrote:
>
> Hi Juan,
>
> Can you explain what you mean? 
> It's simple enough to catch a reference to the DOM element, and use 
> el.addEventListener(...) from there. You can do this easily from within 
> your components.
> However, that's a really bad idea, as you are binding your code to the 
> DOM, and you loose a lot of benefits that NG2 brings.
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to