[Angular] Multiple Root Components vs Single Root Component

10 views
Skip to first unread message

Vivekanand P V

unread,
Apr 12, 2020, 8:15:21 AM4/12/20
to Angular and AngularJS discussion

Wondering if there is any recommendation for bootstrapping single component vs multiple components.

Since a component hierarchy can easily be set with one root (AppComponent that is), what are the use cases where one go for bootstrapping multiple components? Will there be any performance penalty for using one approach vis-a-vis the other?

Sander Elias

unread,
Apr 13, 2020, 6:23:55 AM4/13/20
to Angular and AngularJS discussion
Hi Vivekanand,

The downside of that would be a bit more memory pressure. As each will be an app on its own, it has to house the injector tree for that app, and all that comes with it. I don't believe performance will be affected too much. Use cases would involve Angular Elements. and "widgets" collection apps.

Regards
Sander

Reply all
Reply to author
Forward
0 new messages