鍍金池/ 問答/HTML5/ angular [routerLink]數(shù)據(jù)綁定怎么寫

angular [routerLink]數(shù)據(jù)綁定怎么寫

  <li nz-submenu [(nzOpen)]="item.open" *ngFor="let item of menuList">
      <span title>{{item.parent}}</span>
      <ul>
          <li nz-menu-item [routerLink]="['/{item.path}']" routerLinkActive="active" *ngFor="let item  of item.children">{{item.child}}</li>
      </ul>
  </li>

[routerLink]="['/{item.path}']" 這里應(yīng)該怎么寫才對(duì)呢

回答
編輯回答
哎呦喂

[routerLink]="/{{item.path}}"

2017年10月30日 18:22
編輯回答
氕氘氚

關(guān)于判斷,有沒有更簡潔的寫法呢?走一步判斷一步真心覺得很冗余!

unblocked games

2018年2月4日 22:56
編輯回答
背叛者

直接 [routerLink]="item.path"

2017年1月21日 22:40