Skip to content

Instantly share code, notes, and snippets.

@khoand0000
Last active August 29, 2015 14:26
Show Gist options
  • Save khoand0000/1519256032bc7b53240a to your computer and use it in GitHub Desktop.
Save khoand0000/1519256032bc7b53240a to your computer and use it in GitHub Desktop.
Relation with compile (pre, post), controller, link when defining directive
  • compile is used for transforming template, link is used after template is cloned
  • If compile is existing, link is not effect (be not called)
    • If compile return object, order of functions are called: compile > controller > pre > post
    • If compile return function (post-link), is equivalent to link function, order of functions are called: compile > controller > post
  • If compile is ommitted, controller > link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment