The compile function allows you to do work within a directive before the link function runs and then returns the link function. It is almost never used anymore, but is covered here for completeness and very specific business cases where there is effort to be performed before the link function runs.
The compile function allows you to do work within a directive before the link function runs and then returns the link function. It is almost never used anymore, but is covered here for completeness and very specific business cases where there is effort to be performed before the link function runs.

jsnbuchanan/AngularJs-Directives,jsnbuchanan/AngularJs-Directives