primeng
primeng copied to clipboard
p-breadcrumb is not working properly if Observable<string[]> is provided in <li *ngFor>
Then using p-breadcrum with a simple array of elements where x is string[]:
<p-breadcrumb><ul><li *ngFor="let p of x"><span>{{p}}</span></li></ul></p-breadcrumb>
all
Change the x variable to Observable<string[]> and the first first li[fa-home] is missing and all other
Breadcrumb is reimplemented as a native component in beta6 and this is fixed as a result. There is a new menu model api so instead of generating markup yourself, the component will do it and update it according to changes.
<p-breadcrumb [model]="items"></p-breadcrumb>
export class BreadcrumbDemo implements OnInit {
private items: MenuItem[];
ngOnInit() {
this.items = [];
this.items.push({label:'Categories'});
this.items.push({label:'Sports'});
this.items.push({label:'Football'});
this.items.push({label:'Countries'});
this.items.push({label:'Spain'});
this.items.push({label:'F.C. Barcelona'});
this.items.push({label:'Squad'});
this.items.push({label:'Lionel Messi', url: 'https://en.wikipedia.org/wiki/Lionel_Messi'});
}
}