Questions tagged [ng-component-outlet]

18 questions
9
votes
1 answer

How to ngFor on multiple types of components using ngComponentOutlet?

I've got a whatsapp-like chat case of many types of messages that are needed to be displayed differently. Each has its' own component such as TextMessageComponent, FileMessageComponent, etc.. I'd like to be able to ngFor once on my array of…
Kesem David
  • 2,135
  • 3
  • 27
  • 46
5
votes
2 answers

Angular 4 ngComponentOutlet loads dynamic components, but route content is not being rendered

I'm trying to load different 'parent' components and inject route content into these different parent components by targeting ng-content in each parent component. Essentially, each parent component handles the navigation and other boilerplate stuff…
Tom Schreck
  • 5,177
  • 12
  • 68
  • 122
3
votes
2 answers

Angular 11+ MatDialog: inner component's (ngComponentOutlet) html does not trigger

In fact, I'm having more issues with the ngComponentOutlet-embedded component inside the MatDialog. But let's start here. What I'm building I want to display an arbitrary Component inside a MatDialog. I've found a way, but while it works on Angular…
3
votes
0 answers

How to use FormControl with ngComponentOutlet - Angular 5

I'm trying to use dynamic component loading with formControl but it's not affecting my host formGroup. Tried those options: Template: option 1 - not working:
3
votes
0 answers

Angular 4: ngComponentOutlet with ContentChildren

I have a question about dynamic forms. The current situation is that we have a template driven form and the requirement is that the user can reorder the controls and also set some to invisible. For reordering we use dragula but for loading the…
alc
  • 97
  • 1
  • 1
  • 6
2
votes
1 answer

Angular 2, sub-components of dynamic component are not rendered

I'm using this method to inject one component into another component, in my case a form into a sidebar. However from the injected component (the form) I cannot use pipes and shared…
cs.edoardo
  • 494
  • 3
  • 11
2
votes
0 answers

Angular 6 with ngComponentOutlet and data binding / updating

I read a lot about ngComponentOutlet not working with binding, but as far as i understood, all cases wanted something like child <--> parent binding/communication (@Input and @Output, and for that there is an ng-dynamic-component, which works). I…
1
vote
0 answers

How do I pass input and event output to dynamic component in ng-container using ngComponentOutlet?

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:
1
vote
2 answers

Angular named router outlet doesn't work as expected

I've an angular project with the following routing structure, starting from the app root: // app-routing.module.ts const routes: Routes = [ { path: 'admin', loadChildren: () => import('./features/admin/admin.module').then((m) =>…
chenny
  • 769
  • 2
  • 17
  • 44
0
votes
2 answers

ngComponentOutlet: projected content defined in html

Do you know a way to project content to a component outlet with a content defined in the template it self ? I've tried following that doesn't work : @Component({ template: ``, }) export class MyComp {} @Component({ …
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
0
votes
1 answer

Angular: prevent re render of component inside it

I'm writing a table component that will need to be very open to modification for my company. And i decided to go for this: table.component.html
0
votes
1 answer

No provider for "NgComponentOutlet"

I have an Angular 11 application, which imports @angular/material, @ngx-translate, and a lib called icell-data-table. Downloading the example project from the github page I was able to start it witout any problems on my local environment. But upon…
ForestG
  • 17,538
  • 14
  • 52
  • 86
0
votes
1 answer

How to pass html element as child in Angular Higher Order Components (HOC)?

I want to pass an HTML element in my Angular Higher Order Component. Right now I'm passing child element as a @Input decorator. My HOC, Main Container is like this.
0
votes
3 answers

Angular 7: injection with dependencies for ngComponentOutlet

I need to use some kind of @Input() decorator for my ngComponentOutlet. But seems that Angular hasn't this feature. Instead, all things that I want to pass inside my outlet components should be provided via Injector. And it's fine if I want to…
hofshteyn
  • 1,272
  • 4
  • 16
  • 33
0
votes
0 answers

Angular 7 NgComponentOutlet: problems with Injection

I'm sorry if it's a duplicate of someone question. However I couldn't find solution for my problem. Angular 7. I need to input my variable as @Input into the ng-container via ngComponentOutlet. As says documents, there is an option to make it via…
hofshteyn
  • 1,272
  • 4
  • 16
  • 33
1
2