I understand how Angular dependency injection works with directives but wanted clarification on something. I have a dummy test directive as follows:
app.directiv
In this case, you're receiving the same service, so it likely doesn't matter too much. I personally prefer to keep them as localized as possible; if you don't need $filter
in the link
function or something like that, I'd just inject it into the controller.
In certain cases, this may also make it easier to mock dependencies during testing.