http://stackoverflow.com/questions/17583004/call-an-angularjs-controller-function-from-a-directive-without-isolated-scope
On Wednesday, April 16, 2014 6:57:35 PM UTC-6, Michel Morelli wrote:
>
> Hi all,
>
> I have a custom directive.
>
> In my html i write this:
>
>
> <uploader action="/rest/file/create_from_form.json"
> success="writeFid()"></uploader>
>
> What I need is to exec "success" attribute function passing some parameter
> data that I get from my directive. I can exec "success" attribute function
> via
>
> $scope.$eval($scope.success)
>
> and in my "controller" I have this:
>
> $scope.writeFid = function (data) {
> console.log("Into writeFid");
> console.log(data); //this is my problem: it is always undefined.
> }
>
> I can see (via console.log() messages) that "success" function is called
> but without passing "data".
>
> I have tried to use
>
>
> <uploader action="/rest/file/create_from_form.json"
> success="writeFid(data)"></uploader>
>
> but it does not work.
>
> So: how can i pass some type of $scope.data ?
>
> Thanks.
>
> --
> Davide Morelli
> [email protected] <javascript:>
>
>
>
>
>
--
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.