angular2-component-outlet icon indicating copy to clipboard operation
angular2-component-outlet copied to clipboard

Using selected components template

Open MarkPerryBV opened this issue 9 years ago • 2 comments

I don't want to provide the template to the dynamic component I want to use the one on the type being injected.

e.g.

@Component({
template: 'Hello World, <-- use this template
selector: 'hello-world'
})
public class HelloWorldComponent{}

<div *componentOutlet="context: self; selector:'hello-world'"></div>

MarkPerryBV avatar Sep 14 '16 10:09 MarkPerryBV

See #14

Just replace DynamicComponent with the HelloWorldComponent. I'm not sure if you run into problems, if your ComponentOutlet-Selector and DynamicComponent-Selector are identical. Just to be safe replace

<div *componentOutlet="context: self; selector:'hello-world'"></div> with <div *componentOutlet="context: self; selector:'my-dynamic-component'"></div>

j-moeller avatar Sep 14 '16 11:09 j-moeller

I want a repro. You can use a base plunker if you need. https://plnkr.co/edit/dhRQ3U?p=preview

lacolaco avatar Oct 11 '16 01:10 lacolaco