Are you looking at event or event.event? Looks like you've attached $event to event.event there.
e On Sat, Jul 19, 2014 at 12:54 PM, Diego Freitas <[email protected]> wrote: > Hey guys, > > I've been facing a problem to build a module for me. > > I have this structure: > > *Calling my directive *- passing a postComment function that is inside > the moduleService which is inside the controller > >> <div input-directive class-name="globalInput" >> *post-comment="moduleService.postComment($event, >> comment)"* msg-placeholder="Redija um comentario..." >> class="mainComment"></div> > > > *Directive* > >> .directive('inputDirective', function(){ >> return { >> restrict: 'A', >> scope: { >> postComment: '&', >> msgPlaceholder: '@', >> className: '@' >> }, >> template: "<textarea ng-model='comment' class='{{className}}' >> placeholder='{{msgPlaceholder}}' "+ >> "*ng-keyup='postComment( {event: $event}, {comment: comment} )'* >> ></textarea>" >> }; >> }); > > > When the function is called I can see the comment object - but the event > is undefined. > > *Service* > >> this.postComment = function(*event*, *comment*){ >> //EVENT IS UNDEFINED >> } > > > Does anybody know what is happening? > > Thanks in advance ! > > -- > 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. > -- 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.
