The link function combines the directives with a scope to produce a live view. The link function is responsible for instance DOM manipulation and for registering DOM listeners. The compile function is responsible for template DOM manipulation as well as the collection of all the directives.