Question: what is the difference between compile and link function in angularjs?
Answer: Compile: traverse the DOM and collect all of the directives. Link: combine the directives with a scope and produce a live view. Any changes in the scope model are reflected in the view, and any user interactions with the view are reflected in the scope model.