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

125
Views
Can Multiple Child Component gets a global input param in Angular?

I have a component with input param as name

 <lib-name [name]="name" > </lib-name> 

These are called at multiple places in the project.

Now name is a app-constants which is assigned in app-component.

Currently i have to import name in every component ts file to pass it to library component.

Can we globally define this name for the child-component. So that my code will be clean

<lib-name > </lib-name> 

Note:- Name can change on the basis of signed in user Also it is a library component, i cannot just directly get the name in the library component.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

@Directive({
    selector: '[appTest]'
})
export class TestDirective {
    constructor(private lib: LibComponent) {
        this.lib.name = "Some Name";
    }
}

And use this directive

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