This is basic Angular setup with the minimum required dependencies
npm i
npm start
Open a browser and navigate to http://localhost:8080/
The code examples for the `Here is what you need to know about dynamic components in Angular` article
This is basic Angular setup with the minimum required dependencies
npm i
npm start
Open a browser and navigate to http://localhost:8080/
Hi Maximusk,
First many thanks for your articles and knowledge sharing.
FYI, my final goal is to use an otf component recursively.
But, i am first struggled with a basic (and static) component import in the dynamic module.
[Diff in my fork] (job-so@3a3d4ea)
The new C component template is totally replacing the B component template (there is no C component tag anywhere in templates)
Do you have any ideas / recommendations ?
Thank you
Noob here, I can manage to save html templates in a db, then read them and generate components on the fly based on the stored html code passed to the "template" const, but I can't think of how I would manage to do the same with the associated TypeScript code (the class for the component). Can someone please help? Thanks a lot for the guidance!
By running npm i
and npm start
the application should start
By running npm i
and npm start
An error is produced
Node version:
node -v
v12.16.1
npm start
> [email protected] start /secondary/tmp/angular-test/Here-is-what-you-need-to-know-about-dynamic-components-in-Angular
> tsc && concurrently "tsc -w" "http-server . -c-1 "
node_modules/@types/node/index.d.ts:20:1 - error TS1084: Invalid 'reference' directive syntax.
20 /// <reference lib="es2016" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `tsc && concurrently "tsc -w" "http-server . -c-1 " `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Hi Maximusk,
Firstly many thanks for your article.
We are getting HTML and Typescript class code as part of HTTP call. Using that we want to create component with HTML template and Typescript class on the fly.
We are able to set HTML dynamically but not Typescript class on the fly. Have created issues on Stackover flow as-well, link
Waiting for further communication.
With Angular 9 Ivy is available, it should support dynamic components better. I read through some articles at In-depth.dev, but still can’t figure out how to compile a dynamic component with template on the fly with new Angular Ivy. Could you give some insights on to do these with Ivy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.