post link vs pre link in Angular js directives

后端 未结 1 1372
情话喂你
情话喂你 2020-12-05 13:45

As outlined here:

http://docs.angularjs.org/guide/directive

Angular js directives take two different types of link functions:

Pre-linking function Ex

相关标签:
1条回答
  • 2020-12-05 14:34

    The only time you'd want to use a pre link is when you need to perform some preparation on the scope before any child elements compile.

    My team has used it when writing a grid directive to define the grid object on the scope and setup some of its properties that are needed before any of the child row and cell objects are compiled.

    Hope that helps!

    0 讨论(0)
提交回复
热议问题