Question - Explain the linking function and its types
Answer -
Link combines the directives with a scope and produces a live view. For registering DOM listeners as well as for updating the DOM, link function is responsible. After the template is cloned, it is executed.
• Pre-linking function: Pre-linking function is executed before the child elements are linked. It is not considered as a safe way for DOM transformation.
• Post linking function: Post linking function is executed after the child elements are linked. It is safe to do DOM transformation by post-linking function