Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
Appending an Angular 2 Component to a Specific DOM

Before anyone says anything I'm aware that it's not best practice to mix Jquery and Angular2. However, I have a layout manager (golden-layout) which is reliant on Jquery. Once the individual tiles have been created, I'd like to attach an Angular 2 component that consists of charts/tables to the tile.

So I can easily get the container through the API, but it's from a jquery selection. How can I turn that into a ViewContainerRef so I can attach a component to it.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

 export class ComponentService { constructor(private componentFactoryResolver: ComponentFactoryResolver, private appRef: ApplicationRef, private injector: Injector) { } create(component){ // get factory and create component let factory = this.componentFactoryResolver.resolveComponentFactory(component); let ref = confirmDialogFactory.create(this.injector); // set input prop ref.instance.prop ='ABC'; // attach to dom document.querySelector('body') .appendChild(ref.location.nativeElement); // run change detection this.appRef.attachView(ref.hostView); ... }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!