Skip to content

An easy to follow example showing how to load Angular components dynamically.

License

Notifications You must be signed in to change notification settings

CoderHausTS/easy-angular-dynamic-component-example

Repository files navigation

Dynamic Component test project.

This project aims to show a an easy method of adding dynamic components to your Angular apps.

While looking through examples, including that shown on Angular's own site https://angular.io/guide/dynamic-component-loader, I found that the examples were much more complex than was needed. This led to my pulling a few of these examples apart and determining the absolute minimum need to load dynamic components.

The example I came up with is shown here, using a dropdown to select which component will be shown.

More information about this example can be found at {to be developed}

This project was generated with Angular CLI version 8.3.20.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

About

An easy to follow example showing how to load Angular components dynamically.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published