Siyuan,
"args" are the arguments which are passed to the $emit/$broadcast methods
which invoke the methods registered using the $on. Let's see an example
$scope.$emit('myevent', "First Name", "Last Name", 3, "Test"); -> To Emit
$scope.$on('myevent', function(event, fname, lname, role, extra) {
// fname -> "First Name"
// lname -> "Last Name"
// role -> 3
// extra -> "Test"
});
this can be either $rootScope or any scope.
On Tuesday, 11 March 2014 22:10:43 UTC+5:30, Siyuan Wang wrote:
>
> I have looked through the api doc from Dash of my mac, the doc only shows
> that
>>
>> The event listener function format is: function(event, args...)
>
> which doesn't explain what the "args" is! That means *nothing* for me.
> Where can I find the *exact format *of the listener function?
>
--
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.