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

175
Views
How to access angular Component from other Component

in my Angular Application I try to access a Component, which I want to clone in an other component.

import { Component } from '@angular/core';
import { CloneComponentComponent } from './clone-component/clone-component.component'; // I want to access this component

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'UserManager';

  cloneUpper(){
    console.log("Cloned!");
    var cln = new CloneComponentComponent(); 
    console.log(cln);  //This returns CloneComponentComponent {}, so it is empty
    console.log(cln.toString()); //This return [object Object]
    var container = document.getElementById('cloneContainer');
    container?.append();
  }
}

As you can see the "cln" variable is empty but I do not really know how else I should access this component.

about 4 years ago · Juan Pablo Isaza
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!