how to implement breadcrumb using angular2's router [duplicate]

笑着哭i 提交于 2019-12-07 08:08:49

问题


I use angular2 recently, but don't know how to implement breadcrumb component, any one can help?

<div class="row" style="padding-top:15px;">
   <ol class="breadcrumb">
      <li><a [how to?]>home</a></li>
      <li class="active">detail</li>
   </ol>
 </div>

回答1:


Doesn't seem to be too easy currently.
There is an open issue to support this use-case https://github.com/angular/angular/issues/5318




回答2:


well me too want to use Breadcrumb for my project and after searching alot found Nothing about Breadcrumb , so have decided to create my own. so by using bootflat styling (http://bootflat.github.io/documentation.html) i have created my own Breadcrumb for angular2 project. This Breadcrumb also support Routing in angular2. you just have to use these predefined components given here in the repo.

https://github.com/MrPardeep/Angular2-DatePicker

here is the code for using Breadcrum in HTML file:

<breadcrumb>
    <tab name="Home" icon="glyphicon glyphicon-home"></tab>
    <a [routerLink]="['/Components']">
        <tab name="Cutom Angular 2 Components" icon="glyphicon glyphicon-home"></tab>
    </a>
    <tab action="active" name="Datepicker" icon="glyphicon glyphicon-list-alt"></tab>
</breadcrumb>

hope this may help you and will useful for others too.

here is Demo for the Breadcrumb.



来源:https://stackoverflow.com/questions/35570624/how-to-implement-breadcrumb-using-angular2s-router

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!