Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
1 answer
49 views

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 ...
Sam Redmond's user avatar
0 votes
0 answers
47 views

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: [{ ...
Raziel's user avatar
  • 140
1 vote
1 answer
93 views

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 {...
sanjihan's user avatar
  • 6,138
4 votes
2 answers
445 views

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 ...
Lebanta's user avatar
  • 53
1 vote
1 answer
67 views

Inside global-component I have method for dynamically creating component const comFactory = this.resolver.resolveComponentFactory(ParentComponent); const component: any = this.componentContainer....
Sara's user avatar
  • 751
1 vote
1 answer
81 views

I am using below code to render my components dynamically - @for(item of list(); track $index){ <!-- dynamic rendering using ng-container --> <ng-container *ngComponentOutlet=&...
Prafull Dhadkar's user avatar
1 vote
0 answers
73 views

I want to dynamically create the injector for embeddedView and for that purpose I use Injector.create() method: const myInjector = Injector.create({ providers: [ { ...
Raziel's user avatar
  • 140
0 votes
1 answer
102 views

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 ...
Eternal Sunshine's user avatar
1 vote
1 answer
45 views

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 /&...
Link's user avatar
  • 1,741
1 vote
1 answer
238 views

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 ...
Miles Winokur's user avatar
2 votes
1 answer
104 views

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 ...
jayalakshmi.k's user avatar
1 vote
0 answers
248 views

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. ...
buddhi chamalka's user avatar
0 votes
1 answer
62 views

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 ...
Charan Segaran's user avatar
1 vote
1 answer
111 views

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 ...
DeuceyPoo's Dad's user avatar
2 votes
2 answers
467 views

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 ...
Brian's user avatar
  • 1,449
0 votes
2 answers
643 views

I have created a child component and use Angular Material. I am showing dynamic data which is passed to parent component. I am unable to action icon and name so that I can pass event in parent ...
Abhinay kumar Mishra's user avatar
1 vote
1 answer
771 views

I'm implementing a directive to add actions to a mat-table's mat-cell: <ng-container matColumnDef="actions"> <mat-header-cell *matHeaderCellDef></mat-header-cell> <...
Stefan's user avatar
  • 41
0 votes
0 answers
133 views

I create dynamic component: const comp = createComponent(componentType, { environmentInjector: this.appRef.injector, elementInjector: ...
Raziel's user avatar
  • 140
0 votes
2 answers
908 views

I can create a component dynamically and project some template inside it just fine with the following code - @Component({ selector: 'dynamic', template: ` <p>Dynamic Component<...
atiyar's user avatar
  • 8,385
0 votes
3 answers
711 views

I want to open a component from a service without having to add that component to every other component which has the service. In the service I have the following: @Injectable({ providedIn: 'root', }...
B34v0n's user avatar
  • 11
3 votes
0 answers
1k views

I'm using dynamic components (angular v16) to dynamically render a template. For generic templates with standard html everything works fine, but cannot find a way to use components from material ...
hal9000's user avatar
  • 31
0 votes
1 answer
651 views

In the Angular docs' usage notes for ViewContainerRef I just don't get the statement inject(ViewContainerRef). I'm pretty new to Angular and trying to find my way through the djungle of deprecated ...
Miron Foerster's user avatar
0 votes
1 answer
557 views

My 16.1.4 angular app is dynamically loading a component. Inside that component I have an array and am trying to use ngFor. ngFor will not display anything. If I show the number of entries in the ...
happyfirst's user avatar
  • 1,167
0 votes
1 answer
800 views

UPDATES: Link to Repo Read a lot of documentation and checking examples, but unfortunately I have the worse combination ever. Lazy loading, dynamic import, absolute path with variable : I have Angular ...
Katya's user avatar
  • 1
0 votes
1 answer
59 views

I have a container that contains two independent components. The list of users comes to the first component from the backend part. When clicking on a specific user, I need to show all of his complete ...
Alex's user avatar
  • 471
0 votes
0 answers
63 views

I have two questions. I have a component ParentComponent inside it look like it: @ContentChildren(ChildComponent) contentChildren!: QueryList<ContentChilrder> @ViewChildren('childName') ...
Raziel's user avatar
  • 140
0 votes
0 answers
62 views

I am using Angular 6 in my application. After calling a Web Api I compose an Angular route Url, for example /module-name/component-name/par1Value/par2Value/par3Value. I now want to show the component ...
ExpRick's user avatar
2 votes
1 answer
930 views

I've been banging my head against a wall for a while now trying to solve this problem. We have content coming in from an epi-server, the content is in HTML and needs to rendered dynamically in a ...
Alfred Sköld's user avatar
-2 votes
1 answer
265 views

Folder structure of the project (for reference) dynamic-container.component.html <h1>Dynamic component in angular</h1> <ul> <li (click)="createComponent(productNames....
Saunak Nandi's user avatar
0 votes
1 answer
549 views

I have a service that creates a dynamic component in a slide component. // service open<T, R>(component: Type<T>, params?: { wide?: boolean; data?: R }): IxSlideInRef<T, R> { ...
Raz-Dva's user avatar
  • 25
3 votes
0 answers
504 views

I've taken over an old Angular project at my work and I'm tasked with upgrading it from version 6 to 14. I've gone one version at a time as recommended by the Angular Update Guide. But now at version ...
Alfred Sköld's user avatar
2 votes
3 answers
4k views

I'm trying to pass an event emitter and input to a dynamic component, but not able to get it through. My angular version is 10. I want to perform something like this: <ng-container [...
Miraj's user avatar
  • 53
2 votes
0 answers
414 views

I am going to add a dynamic component to the Angular template. Usually, it is done by creating a dynamic component via the existing ViewContainerRef in the template. But what about the situation where ...
Sergey E.'s user avatar
0 votes
1 answer
309 views

I need to force a class to implement a method say okClick so I created an interface interface BaseComponent { okClick(): void } and made my class implement the same. class ComponentImplementation ...
SoftEngi's user avatar
  • 417
0 votes
1 answer
217 views

I'm using Dynamic component loader to generate parts of form out of custom components. As I don't know up front how much of them will be, I've decided to use FormArray builder. Unfortunately it can be ...
KGROZA's user avatar
  • 93
0 votes
1 answer
431 views

I'm trying to create components dynamically using the ComponentFactoryResolver. I have a component that has an @input that holds the component ref and the component inputs. the problem is when the ...
Or Shalmayev's user avatar
0 votes
0 answers
340 views

I am loading 50 angular components in a ngFor loop formItemList is a array and has 50 angular components <mat-expansion-panel expanded="true" *ngFor="let item of formItemList; let i =...
Shashank Dhasal's user avatar
0 votes
0 answers
307 views

Started this app 5 years ago with Angular 2, till Angular 13 the dynamic routes lazy loaded works fine (with canActivate DynamicPathGuard), after a upgrade/update to NG 14/15 the browsers keeps ...
Patrick Ritskes's user avatar
1 vote
1 answer
563 views

I want to load component from different lazy loaded module as per my menu selected. My menu comes from database table. say as ex. as below: MenuComponent MenuID Customer 1001 Supplier 1002 I have ...
Parth M. Dave's user avatar
0 votes
1 answer
3k views

@ViewChild(ComponentType) comp!: ComponentType; ngAfterViewInit() { console.log('ComponentType instance', comp); } To get hold of a child component's instance, I know that ViewChild can be used as ...
karthikaruna's user avatar
  • 3,276
0 votes
1 answer
347 views

Im trying to add the component and module dynamically as shown below Component: protected createNewComponent (tmpl:string) { @Component({ selector: 'dynamic-component', template: tmpl, ...
bvakiti's user avatar
  • 3,691
1 vote
1 answer
909 views

This is my 3rd attempt at asking this question. This question will be long since I see no way of making it short. Objective What I’m trying to do is to have a simple web-app that has a header (which I’...
SneakyShrike's user avatar
0 votes
2 answers
5k views

Link to updated question. I posted this question before. To briefly summarise; I’m trying to call a function that creates instances of a component using the ComponentFactoryResolver and ...
SneakyShrike's user avatar
0 votes
1 answer
1k views

Trying to add a component to the DOM with ViewContainerRef createComponent. However, the component depends on NgControl. The end goal is to add components to a form using the FormBuilder. Can't seem ...
bunchOfModelos's user avatar
-1 votes
1 answer
1k views

Update to this in this new question. I have followed this guide which I found by finding this question but then being pointed to this question as a fix for some of the issues that occurred in the ...
SneakyShrike's user avatar
0 votes
1 answer
176 views

I have a multidimensional array of components I want to render to a grid: [ [ { component: class TitleComponent, data: { title: "Invoice" }, row: 1 }...
fourie_lean's user avatar
5 votes
1 answer
5k views

I would like to render an Angular component (an overlay) as a direct child of the documents body element. Today this can be done as follows: constructor( private applicationRef: ApplicationRef, ...
kremerd's user avatar
  • 1,656
0 votes
1 answer
72 views

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 ...
Daniel's user avatar
  • 383
1 vote
0 answers
335 views

So I want to add a component inside of some HTML that has been inserted into the DOM through [innerHTML]. My current approach is as follows, but I am stuck at trying to obtain an ElementRef... I am ...
Nutch's user avatar
  • 11
0 votes
1 answer
831 views

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 ...
Leslie Hanks's user avatar
  • 2,377

1
2 3 4 5