I'll open this up bit more;
I could have voteService that returns doSomething function.
Now from my checkbox directive I could
1) Inject voteService
directive('checkboxHandler', function(voteService) ... and call doSomething
directly
or
2) By using isolated expression scope I could do something like
controller('MainController', function($scope, voteService) {
$scope.doSomething = function() {
voteService.doSomething();
}
}
and pass doSmething as expression isolated scope to directive
<checkbox-handler do-something="doSomething()"></checbkox-handler>
and then in directive scope wire it up
scope: {
doSometing: '&'
}
--
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/groups/opt_out.