Giter VIP home page Giter VIP logo

here-is-what-you-need-to-know-about-dynamic-components-in-angular's Introduction

Angular seed

This is basic Angular setup with the minimum required dependencies

Running the app

npm i
npm start

Open a browser and navigate to http://localhost:8080/

here-is-what-you-need-to-know-about-dynamic-components-in-angular's People

Contributors

maxkoretskyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

here-is-what-you-need-to-know-about-dynamic-components-in-angular's Issues

Importing modules in B dynamic module (compiled by otf)

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)

image

Do you have any ideas / recommendations ?

Thank you

How to manage ts code in this OTF scenario?

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!

Error during npm start

Expected behavior

By running npm i and npm start the application should start

Actual behavior

By running npm i and npm start An error is produced

Node version:
node -v
v12.16.1

Error output

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.

Typescript code on the fly

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.

How to do these in Angular 9 Ivy

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.