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
0 answers
Can't combine static element and in Angular for getting ElementRef
I tried to get index of child component in ParentComponent. My structure of ParentComponent was
…

Malvin Patrick
- 35
- 1
- 6
0
votes
0 answers
Angular Dynamic Component not Loading in build
I have a requirement to render HTML coming from DB. So I created a dynamic component at runtime and passing the HTML in it. Then I created a dynamic module and passed this dynamic component class to the module. Then I rendered this module using the…

Amit Singh
- 279
- 2
- 7
0
votes
1 answer
Angular component with dynamic template created using ɵcompileComponent (Angular 9) is not working in production mode
I am creating a dynamic component in Angular 9. I have a
- tag in the html template, the sub-elements of which are dynamically loaded from the server (The server will return values like
- One
- Two
-
aby040
- 41
- 2
0
votes
0 answers
Adding runtime components to angular application
We are building an angular application which allows 3rd party components to be integrated. These components are not available as packages during the build process as we do not know the 3rd party components that can come. The contract between the…

Apps
- 3,284
- 8
- 48
- 75
0
votes
2 answers
How to update a value in the dynamically added child component in Angular 9
I have a parent component that dynamically adds child components
@Component({
selector: 'app-parent',
template: ` `
})
export class ParentComponent implements OnInit {
@ViewChild('dynamic', {…
Parent:

K.Shikha
- 107
- 2
- 14
0
votes
2 answers
How to do Calculations On Multiple Form Fields - angular2+
I am working on reactive forms of angular where I have a requirement in the forms as below
Lets say I have 4 input fields.

T Naveen
- 23
- 3
0
votes
0 answers
How to get list of dynamically created components in Angular?
I'm trying to create components dynamically. The simplified code which creates the component looks like this -
loadDynamicComponent(container: ViewContainerRef, template, data: any, settings?: any) {
const cfr =…

Lars
- 920
- 1
- 14
- 34
0
votes
1 answer
Why is change detection not triggering on nested dynamic component
I have an issue with change detection on nested dynamic component using content projection.
Change detection is not triggering automatically on the child component, I have to add manual change detection to every actions.
An exemple here :…

Sa Hagin
- 502
- 1
- 7
- 18
0
votes
1 answer
How to get an instance of a dynamic angular component during a test?
Here's my code:
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentClass);
const dialogElement = document.createElement('some-dialog');
const componentRef = componentFactory.create(
…

yccteam
- 2,168
- 4
- 25
- 47
0
votes
1 answer
PrimeNg TabView dynamic component
I am following this approach to dynamically create elements in an AngularApp based on a configuration JSON.
Unfortunately that does not seem to work with all of the PrimeNG components. Especially not the TabView which I wanted to utilize as well.
I…

nico525
- 137
- 1
- 8
0
votes
1 answer
How can I scroll into view for dynamic loaded content in Angular 11?
In my app I need to load HTML from a file. This file contains plain HTML code and come anchors. Now, when I click on such an anchor I would like to scroll this anchor into view. Therefore I wrote the following code:
HTML code
…

Lars
- 920
- 1
- 14
- 34
0
votes
0 answers
How to create dynamic html with dynamic component in Angular 10?
I've read carefully about these questions: Equivalent of $compile in Angular 2 and How can I use/create dynamic template to compile dynamic Component with Angular 2.0?
And I tried to understand the code in this woring plunker mentioned in these…

Liem
- 446
- 1
- 6
- 20
0
votes
1 answer
projectableNodes in directive using IVY - Failed to execute 'insertBefore' on 'Node'
What's wrong with that code:
@Directive({
selector: '[appDir]'
})
export class DirDirective {
constructor(
private vcr: ViewContainerRef,
private compFactoryResolver: ComponentFactoryResolver
) {}
ngAfterViewInit() {
const…

IsraGab
- 4,819
- 3
- 27
- 46
0
votes
1 answer
Angular Dynamically resolved components using nested Reactive Forms with CVA's are not working
Arrgh, Having problems with Dynamically built components using ReactiveForms.
Need to trigger and Mat-Dialog and load set of components in it - works fine.
Need to build some of the components dynamically from a mapping array - works fine.
Need to…

cuznerdexter
- 586
- 5
- 21
0
votes
1 answer
Angular dynamic component with ng-template
Component with ng-template
@Component({
template: `
`,
})
export class HelloComponent {}
When rendered with…
Hello Component is here!
Template content

Aleksandar Petrovic
- 1
- 1
- 2