2

I am planning to add dynamic components at certain location in my Angular 2 app. I tried adding anchor points but it didn't work.

1 Answer 1

3

Use an anchor Point in html

In ts file

constructor(private componentFactoryResolver: ComponentFactoryResolver,
    private viewContainerRef: ViewContainerRef) {}

Create a component factory Get the reference of the anchor point Bind any data if required Run detect changes for updating it

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.