Questions tagged [angular-dynamic-components]

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.

203 questions
0
votes
1 answer

Dynamically injecting component vs controlling it via *ngIf

I have a scenario where I have a component which does some http requests to show data and if there is an exception while doing so, I want to show instead just the error component. Does it make sense to have the error component already on the…
Saksham
  • 9,037
  • 7
  • 45
  • 73
0
votes
1 answer

Dynamic Component Loading - get component as variable

I'm implementing a relatively complex component loader in Angular, and I'd like to dynamically get the component instance from a rxjs store. loadEditAreaComponent(component: any, componentInstanceData?: {}){ const componentFactory =…
noamyg
  • 2,747
  • 1
  • 23
  • 44
0
votes
1 answer

Angular 10 | FormControl in Dynamic Component

I'm trying to resolve a simple task: dynamically load a component contains a form control. Everything is OK except I get such error: ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous…
0
votes
0 answers

How to bind and emit dynamic events in dynamic component in angular

I am following this excellent article to create dynamic components in angular and it works properly. Its passing an array of elements to be rendered dynamically in below format. config.push( { type: 'select', label: 'Month', …
Sunil Chaudhary
  • 397
  • 1
  • 9
  • 31
0
votes
1 answer

angular dynamic component - checkboxes show in rows with condition

I have an angular app that creates dynamic components like checkbox ,radio button ,textbox etc from server configuration . here i have to show the checkboxes with column settings .Lets say, you have 6 checkboxes and its number of columns are 3 , I…
AhammadaliPK
  • 3,448
  • 4
  • 21
  • 39
0
votes
1 answer

having an empty page while calling a dynamic component angular 9

I try to call a dynamic component from another component but it showing me an empty page This is the dynamic component.ts : @Component({ selector: 'app-draw-linechart', templateUrl: './draw-linechart.component.html', styleUrls:…
foufa oueslati
  • 121
  • 1
  • 11
0
votes
0 answers

Why is a dynamically instantiated component clipped?

I am implementing a Timeline component whose bars can have tooltips. The Timeline component is used in another component that displays a list of these Timeline controls. In the below screenshot I have: Blue: List component Green: Timeline…
Nicolae Daian
  • 1,065
  • 3
  • 18
  • 39
0
votes
1 answer

Dynamic component in expandable row of table

I wanted to add custom component which will be added dynamically to template. In the first row it works but in the following it event does not appear in DOM. Do you know why and how to fix it - example?
0
votes
1 answer

Dynamic component loader - Cannot read property 'viewContainerRef' of undefined

im following all steps of the ad-banner tutorial on Angular.io. But at the end after all setup, i get an error comming from this component and function: Ad-banner.component TS loadComponent() { this.currentAdIndex = (this.currentAdIndex + 1) %…
Mellville
  • 1,027
  • 2
  • 18
  • 39
0
votes
0 answers

How to load structure of page dynamically in angular

i want to load structure of page dynamically in container component that means all div elements and CSS classes are loaded dynamically in angular ? how we can achieve this? currently i am able to load component dynamically in this element but now…
0
votes
1 answer

Component does not create dynamically to div specified using ViewChild in Angular

I'm trying to append/create into a specific div a component. However, the component is being created but not where I would like it to be. What I'm doing wrong? I would like the k-sidebar component to be inside the div I'm showing into the image.…
Csibi Norbert
  • 780
  • 1
  • 11
  • 35
0
votes
0 answers

Adding Angular dynamic Component to a specific place using @Viewchild

Angular CLI: 8.3.26 // Angular: 8.2.14 I use a directive (open-chatpanel.diretive.ts) in order to create dynamic components. Everything is ok except that : I can't figure out how to add it into a specific place ?!? Here is the directive…
0
votes
2 answers

Dynamic Angular Forms: How to Set Input Width Dynamically for Each Control

I don't know if this is possible but i have built a dynamic form component which works quite well and i can control a number of items through a configuration file. One item i have not been able to control is the width of the input field, I have…
0
votes
1 answer

Creating dynamic angular 8 components and html element and rearranging them

I have the following problem. I have an array with angular 8 component names and html elements. Currently it is creating the angular 8 components and the html elements but does not arrange them like they are sorted in the array. This is my…
0
votes
2 answers

How to use ng-template inside innerHTML in Angular

Can someone help me, how to use ng-template inside innerHTML tag, Stackblitz Demo: https://stackblitz.com/edit/angular-xgnnj4 What I wanted to do is, In the Component HTML
In the Component…