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
Post a Comment