220 questions
2 votes
1 answer
52 views
Angular dynamic questions causing infinite re-renders
I am trying to generate dynamic forms based on a set of questions I receive from an API. When the app inits I will dispatch a state action that will call the mock API to get the questions and then the ...
0 votes
0 answers
51 views
Tracking when dynamic structure of components is fully rendered in Angular
I have a nested structure of components in form of JSON that I get from an API. componentStructure$ = apiCall(); The JSON looks like this: structure = { component, innerComponents: [{ ...
1 vote
1 answer
93 views
`this` not set to component instance when creating component programatically
I have a directive that reads src attribute and appends a DynamicComponent. It also sets an input property of DynamicComponent. @Directive({ selector: '[appDynamic]' }) export class InjectDirective {...
4 votes
2 answers
455 views
How to use formControlName (ng_value_accessor) with ngComponentOutlet in Angular for dynamic form components
I'm working on a dynamic form in Angular where I need to use ngComponentOutlet to dynamically load different components based on the field type. However, I'm struggling to bind formControlName to ...
1 vote
1 answer
71 views
Access child component from dynamically created component - Angular 12
Inside global-component I have method for dynamically creating component const comFactory = this.resolver.resolveComponentFactory(ParentComponent); const component: any = this.componentContainer....
1 vote
1 answer
81 views
Is there a way to bind event in dynamically rendered components in angular using templates?
I am using below code to render my components dynamically - @for(item of list(); track $index){ <!-- dynamic rendering using ng-container --> <ng-container *ngComponentOutlet=&...
1 vote
0 answers
73 views
Using Injector.create() to dynamically create injector for embedded view is not working when parent injector is provided via parent property
I want to dynamically create the injector for embeddedView and for that purpose I use Injector.create() method: const myInjector = Injector.create({ providers: [ { ...
0 votes
1 answer
102 views
How can I project dynamic filter chips using `ng-template`, `ngTemplateOutlet`, and `ng-content` in Angular?
I'm working on an Angular application where I need to build a reusable filter bar component that displays dynamic filter chips based on user selections. The filter chips need to be projected into the ...
1 vote
1 answer
45 views
Override ngComponentTemplate from root component
I am trying to wrap my head around the following issue. In the root-level app.component you have the following structure: <div class="container"> <sidebar /> <menu-bar /&...
1 vote
1 answer
240 views
Deprecated ComponentFactoryResolver, Trying to use ViewContainerRef
I am trying to setup my auth.component.ts file to use ViewContainerRef from the placeholder.directive.ts file, but I am unsure what I need to populate inside the createComponent() at the end of the ...
2 votes
1 answer
106 views
Dynamically loading and rendering External files as component in angular
I have a use-case, where I should render an external angular component or web-component in an angular application. I have created a sample application (stackblitz) to reproduce the scenario and below ...
1 vote
0 answers
248 views
How to dynamically create and manage multiple popup dialogs in Angular?
I am working on an Angular(17.x) project where I need to create and manage multiple popup dialogs dynamically. I aim to avoid manually creating separate components, inputs, and outputs for each popup. ...
0 votes
1 answer
63 views
Dynamically injected component's data is not being displayed in main component in Angular
I am currently trying to display a component's html view in another component in a chatbot setting. Let's call them chat component and component 2. So basically chat component which renders the main ...
1 vote
1 answer
112 views
Angular Material Table filtering of dynamic components
I often use components to display cell data in an Angular Material Table, including dynamic components created with ngComponentOutlet. When filtering those tables, I can't seem to properly filter ...
2 votes
2 answers
469 views
Angular directive @Input ignored when added to component via directive composition
I think I'm missing something very basic here, but I've been staring at this for too long. According the docs and everything else I've seen, an Angular directive's @Input() will be accessible on a ...