Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda