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.

Reply via email to