Hi! You are expecting to catch a bubbling event so you should use ^ before the event name:
<button class="btn btn-primary" (^click)="getDataHandler()" > Having said this, I'm not sure why exactly we are not catching bubbling events by default, so you might open an issue sharing your experience / expected defaults. There is also discussion going around bubbling of custom events here: https://github.com/angular/angular/issues/2296 Cheers, Pawel On Tue, Aug 4, 2015 at 11:33 AM, Pete Moss <[email protected]> wrote: > In Angular2, I have the following markup in my template (uses Font Awesome > with Bootstrap): > > <button class="btn btn-primary" (click)="getDataHandler()" ><span class="fa > fa-bicycle fa-lg"></span> Get Data</button> > > > Problem is that if I click on the Font Awesome bicycle glyph (the <span>), > the click event does not fire and the getDataHandler() is not being called. > I get the event if I click on the text part of the button however. I > wouldn't expect this. Am I doing something wrong? > > -- > 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 http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. -- AngularJS book: http://www.packtpub.com/angularjs-web-application-development/book Looking for bootstrap-based widget library for AngularJS? http://angular-ui.github.com/bootstrap/ -- 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 http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
