Why is transclusion enabled by default? If I'm creating a component with the default settings but not leveraging transclusion is there a small, unnecessary overhead cost there? We rarely use transclusion in our directives so the fact that it's enabled by default has me curious whether we're designing our directives correctly/optimally.
Great article overall though. I'm excited to use Component. We've been keeping on top of upgrading with each minor release, and so far it's been a breeze.
is there a small, unnecessary overhead cost there?
Not really; the cost is negligible to say that transclusion can happen (it's setting a flag during directive setup that has to be set one way or the other). The cost for transclusion is incurred when the transclusion actually happens; eg, when your component depends on and calls the $transclude function.
4
u/chazzlabs Nov 13 '15
Why is transclusion enabled by default? If I'm creating a component with the default settings but not leveraging transclusion is there a small, unnecessary overhead cost there? We rarely use transclusion in our directives so the fact that it's enabled by default has me curious whether we're designing our directives correctly/optimally.
Great article overall though. I'm excited to use Component. We've been keeping on top of upgrading with each minor release, and so far it's been a breeze.