Angular Component Template Size -


if concerned performance, should structure app in angular using fewer components larger templates or more components smaller templates?

it seems if there more components, there lot more lifecycles work through, although there more logic run through bigger templates.

anyone have ideas of how these 2 approaches affect app performance?

do not focus on performance related templates. always try structure components/templates in logical way, extract smaller parts reusable components. natural have many small pieces relatively small templates.

if notice performance issues, typically start investigation of how angular runs change detection , how re-rendering html view (that's slow).

starting changedetectionstrategy.onpush can lot, there's perfect article here: angular change detection explained


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -