14. …but we have no root app?
• multiple entrypoints
15. Bootstrapping multiple
applications
• its a little harder to maintain state between applications
(but possible)
• the cms now needs to know what components are
angular-components, so they can all be bootstrapped.
(and their DOM-nodes if multiple of the same
component)
17. Initial data
• We need to feed data (settings, initial data) into some of
the components (from the cms), and put content inside
them.
20. Because
• Root-components cannot have inputs
• Root-components cannot use content-projection
(transclusion)
https://github.com/angular/angular/issues/1858
31. We have too many routes with
no patterns
• “/“ is a frontpage
• “/om/os” is a content-page
• “/mejeri“ is a category-page
• “/mejeri/ost“ is a sub-category-page
• “/ost-i-skiver-mild-13-cheasy-200-g” is a product-page
34. Two issues with that approach
• Need to build and invalidate the bundle’s cache every
time an editor makes a change
• Users get stuck on the route-config they get at first load
40. In angular 1.x we could use templateFactory and
select a template based on the api-response
But we cannot do that in Angular 2+, because
there is no template-parser at runtime
82. The idea
• server.module and a client.module
• they both import the app.module
• server and client module then replaces the
dependencies that are different with appropriate
environment-versions (eg. xhr or node-fetch, DOM or
virtual-dom)
83. Can’t touch this (the DOM)
(no direct window, querySelector, localstorage)
86. Maintaining state
we want to maintain state, so we don’t re-do all fetches
and calculations when the client boots up