angularjs - Are Angular directive controllers only meant for exposing publicly? -


from angularjs directive documentation:

best practice: use controller when want expose api other directives. otherwise use link.

is case use controllers inside directives?

what init functionality such defaulting variable , scope values? should go link, unless publicly exposed?

i use "link" when have implement deeper dom manipulation. "regular" component should use controllers. idea use "link" when don't have other option it's more involved , requires deeper understanding of how angular sj works.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -