Grokking directives

Also useful for understanding how to mock stuff for testing.

Ignore the first suggestion here to use link functions over controllers. The rest is a great explanation of when both of those functions will get called.