1.5 KiB
An app shell lets Universal render a portion of your application via a route at build time. This gives users a meaningful first paint of your application that appears quickly because the browser can simply render the HTML without the need to initialize any JavaScript.
Use this command with a routing app that is accompanied by a Universal server-side app.
To create an app shell, use the following command.
ng generate app-shell my-appmy-app
is the name of your client applicationserver-app
is the name of the Universal (server) application
The command adds two new architect build targets to your angular.json
configuration file (along with a few other changes).
To verify the that the app has been built with the default shell content:
-
Run the app-shell target.
ng run my-app:app-shell -
Open
dist/app-shell/index.html
in your browser.
The default text "app-shell works!" verifies that the app-shell route was rendered as part of the output.