Questions about Angular Dynamic Components, an Angular technique for creating components during runtime. Use this tag for questions which are not specific to an individual version of Angular.
Questions tagged [angular-dynamic-components]
203 questions
0
votes
1 answer
Angular EventEmitter parent This equals with the EventEmitter
My problem is when going back to the parent element after EventEmitter trigger my "this" is the EventEmitter itself at the parent, hence I cannot access any methods/variables which are part of the parent. Am I doing something wrong, or it this how…

Daniel
- 383
- 1
- 5
- 20
0
votes
1 answer
What is the replacement for the Angular Compiler in v14?
I am trying to upgrade to Angular 14. My current app uses the Compiler from '@angular/core' to compile angular templates at runtime. In order to use it I had to include the --aot=false flag when I built. I know has been deprecated for a few…

Leslie Hanks
- 2,347
- 3
- 31
- 42
0
votes
1 answer
How to check if component has specific @Inputs when using createComponent
In my angular app I create components dynamically using the new createComponent function. I think this feature was added in v14.1. Anyway, this is my experiment
import { createComponent, .... } from '@angular/core';
@Directive({
selector:…

Jeanluca Scaljeri
- 26,343
- 56
- 205
- 333
0
votes
1 answer
How to wait for NgOnInit to complete inside Angular Dynamic Component?
I am trying to set reactive form controls inside dynamic component from parent component.
@ViewChild("priceSpecComp", { read: ViewContainerRef}) priceSpecComp: ViewContainerRef
LoadDynamicComponent(variant, addons) {
priceSpecComp.clear();
…

Timsen
- 4,066
- 10
- 59
- 117
0
votes
0 answers
Dynamically Resolved Component showing Wrong value in prod
I am using a splitter(kendo splitter) to render two child component into a parent component at once.

Wasif Mustahid
- 144
- 9
0
votes
1 answer
How to create multiple instances of a dynamic component sequentially?
I have a SystemMessageService which creates instances of SystemMessageComponent using the following method
createSystemMessage(message: string, vcr: ViewContainerRef, time: number = 4500, isErrorMessage: boolean = false, isWarningMessage: boolean =…

Invader
- 141
- 6
0
votes
1 answer
Recursive Dynamic Angular Form based on ng-template, binding missing with Component
I was creating this project (Source Project) https://stackblitz.com/edit/angular-ivy-wkshmk; I had error but I 'solve' (with problems) here https://stackoverflow.com/a/70794789/811293
The problems are: Validations aren't working at Select level 2 or…

joseluisbz
- 1,491
- 1
- 36
- 58
0
votes
2 answers
Recursive Dynamic Angular Form; EmitEvent from Deeper Child to Root (Parent Component)
Hi I'm newbie and I'm creating a project with a Reactive Form; based on Recursive Component that creates Dynamic Form from JSON file. The Sources
This is an adaptation from Ionic based on Creating Dynamic Angular Forms with JSON
I Adapted the…

joseluisbz
- 1,491
- 1
- 36
- 58
0
votes
0 answers
Angular ComponentFactory - How to load component dynamically and replace host container (avoiding to have a new div child instead)
Hello I have a component that acts as Component Factory for a collection of UI components I have.
in order to show a component from my collection I do like this:
in…

MarcoAbi
- 61
- 1
- 6
0
votes
0 answers
Add Dynamic Component to Shopping Cart in Angular
I have a pizza creator App, which allows the user to customize his own pizza and add toppings to it, I want to be able to add these customized pizzas to a cart service and display it in Cart Component.
Choice.component.ts
here is the choice class…

omer khaber
- 15
- 3
0
votes
1 answer
How to bind form group to nested dynamically created components in Angular
In my Angular 12 app I have this type of hierarchy:
- app.component
-- Parent component with form (reactive)
--- Component that creates the dynamic components
---- Dynamic component
and my formBuilder form looks like this:
form =…

AkiS
- 47
- 2
- 9
0
votes
0 answers
Angular - Dynamically select Component
I've read the guide on Dynamic Component Loading, however I'm not quite sure it exactly solves what I would like.
I have the concept of different 'brands' let's say, and based on a 'brand' variable, would like to load a different UI for a number of…

rossco
- 523
- 4
- 20
0
votes
1 answer
Angular dynamic component's property is undefined
I've got a strange error...
I generate dynamic components in the template (a few).
Some of them has property form, which is the FormGroup created via FormBuilder, along with isValid() method.
isValid() returns boolean that depends on this.form.valid…

Jakub
- 3
- 5
0
votes
0 answers
How to dynamically create @Output on an Angular Component?
For the sake of simplicity, Let's say we have a MyComponent with an @Input() eventName = 'signal'.
I would like to use the value signal as the name of a dynamically created EventEmitter. Which I can use as a regular @Output as so:

Alex Pappas
- 2,377
- 3
- 24
- 48
0
votes
1 answer
Angular Dynamic URL in lazy loaded module
I have page which renders content based on the params in the url, current route samples are given as follows,
domain.com/page/:pageId (domain.com/page/123456) renders Home Page
domain.com/page/:pageId (domain.com/page/567890) renders Offers…

Tom
- 183
- 1
- 1
- 9