-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use ngx-component-outlet in ng-template #2
Comments
Hello! Of course, you can use any dynamic component as regular and everything will work. |
Thanks for the quick reply. Using the example above, how would I use your outlet with the ng-template with the component, componentInputs and componentOutputs above. I have been trying it for sometime without any success. Cheers |
You would like use |
An example how to use ngx-component-outlet in ng-template: The host component on which the rendering and binding are hanging @Component({
selector: 'app-dynamic-host',
template: ''
})
export class DynamicHostComponent {
@Input() regularInput;
@Output() regularOutput = new EventEmitter<any>();
} Dynamic component you would like use as regular @Component({
selector: 'app-dynamic',
template: `
<button (click)="regularOutput.emit($event)">
Hello, {{ regularInput }}
</button>`
})
export class DynamicComponent {
@Input() regularInput;
@Output() regularOutput = new EventEmitter<any>();
} AppComponent
And your template
|
Hi,
I like ngx-component-outlet. However, I would like to use in ng-template, similar to the example below with another dynamic component creation library:
Can I do something similar with ngx-component-outlet?
Cheers
The text was updated successfully, but these errors were encountered: