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

155
Visualizações
How to add a new item to p-breadcrum list?

I'm trying to add a new item to p-breadcrumb list on click event, but my code doesn't seem to work. Can anyone point me in the right direction? Thanks in advance!

LIVE DEMO

ngOnInit() {
    this.items = [
        {label: 'Computer'},
        {label: 'Notebook'},
        {label: 'Accessories'},
        {label: 'Backpacks'},
        {label: 'Item'}
    ];
    
    this.home = {icon: 'pi pi-home'};
}

addItem(){
    this.items.push({label: 'testing'})
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Actually, it is adding, but you are not seeing the updates on the page. Replace the way you are visualizing the data in the template for it:

<label *ngFor="let item of items">
  {{item.label}}
</label>

https://stackblitz.com/edit/primeng-breadcrumb-demo-ncapwe?file=src/app/app.component.html

Also, right after using the "push" console log the array, you will be able to see that the data is correct.

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