So, in the end, the compile function is awesome. It's also rarely needed. Most of the time, your
link function will handle all of the heavy lifting for you, and adding in the compile option just creates unnecessary complexity within your code. On the other hand, when you need to be able to manipulate the template element before binding to the scope, or want to conditionally apply the
linker function as the data changes, compile offers you that option. Next chapter we'll dive into scoping, a helpful way to ensure your data is properly linked, yet still modular, both inside and outside your directives.