📄️ Adding top-level routes to a standalone Angular application
To provide the Router service and add top-level routes, pass routes to the provideRouter function and add it to the providers option for bootstrapApplication:
📄️ Bootstrapping a standalone application
Using the bootstrapApplication function
📄️ Configuring the router using standalone features
Configuring the router for a standalone application
📄️ Enabling animations in a standalone Angular application
Enabling browser animations in a standalone Angular application
📄️ Exporting standalone components from Angular libraries
Exporting unrelated standalone components from Angular libraries
📄️ Lazy loading a feature using the Angular Router
Resolving a Routes array
📄️ Lazy loading a standalone component using the Angular Router
Add a loadComponent property to a Route object to lazy load a component. The value is a function that returns a dynamic import statement that points to an ES module (a .ts file), then resolves to the component class:
📄️ Providing dependencies in a standalone Angular feature
Using route providers
📄️ Testing a standalone attribute directive using the Angular testbed
For the purpose of this example, we will create a standalone attribute directive
📄️ Testing a standalone component using the Angular testbed
Creating a component fixture for a standalone component
📄️ Using the HttpClient in a standalone Angular application
As you might know, Angular's HttpClient has many dependencies that we have to provide in Angular applications using it.