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

149
Views
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 answers
Answer question

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 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!