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

159
Views
How to pass a parameter from html page to angular custom element

I've created an angular custom element from an angular component that I want call from a normal html page.

The component requires a parameter, which works when it's called as a component from within an angular project, but I cannot figure out how to pass the parameter from the html tag to the custom element.

Current I'm trying to use:

  @Input() crs: string

in the component and:

<station-info crs="btn"></station-info>

in the html tag, but the crs never makes it into the component.

What I'd like to know is the correct way to pass the parameter from the html tag to the component after it has been converted to a custom element?

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

0

You can use property binding to pass data from parent to child.

Like so, Use property binding to bind the item property in the child to the currentItem property of the parent.

<app-item-detail [item]="currentItem"></app-item-detail>

In the parent component class, designate a value for currentItem:

export class AppComponent {
  currentItem = 'Television';
}

Link to angular docs: https://angular.io/guide/inputs-outputs

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!