[AngularJS] Re: Talking to services

2014-01-02 Thread Karri Niemelä
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

[AngularJS] Re: Talking to services

2014-01-02 Thread Daniel Tabuenca
A few things to consider: If checkboxHandler is meant to be a generic directive where what is done when something is changed can vary, then you would pass in the method to call in your HTML and wire it up through the isolate scope of your directive. If checkboxHandler is always meant to use