Hey, actually the issue is what Jens had said. The use of event instead of
$event. Using event the event is defined. :)

Thanks all!!! Thanks Ciro too :)

On Sunday, July 20, 2014, Ciro Nunes <[email protected]
<javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:

> Can you provide a plunker isolating your issue? It would be a way easier
> to help you. =)
>
> On Saturday, July 19, 2014 4:54:11 PM UTC-3, Diego Freitas 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 a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/O5yj3FN45c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>


-- 


*Diego Freitas*
*    (31)8884-8176*

ConheƧa meu perfil no LinkedIn clicando aqui  [image: Visualizar meu perfil
no LinkedIn] <http://br.linkedin.com/pub/diego-freitas/27/821/21>

-- 
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.

Reply via email to