Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 棱角材料,制造<;mat芯片>;可点击_Html_Angular_Angular Material - Fatal编程技术网

Html 棱角材料,制造<;mat芯片>;可点击

Html 棱角材料,制造<;mat芯片>;可点击,html,angular,angular-material,Html,Angular,Angular Material,我正在使用material.angular.io中的mat芯片 <mat-chip-list class="categories"> <mat-chip><a href="/publication/category/{{category.id}}"> {{category.name}}</a></mat-chip> </mat-chip-list> 如果我用鼠标中键单击链接,链接将工作并打开另一个选项卡

我正在使用material.angular.io中的mat芯片

<mat-chip-list class="categories">
    <mat-chip><a href="/publication/category/{{category.id}}">
    {{category.name}}</a></mat-chip>
</mat-chip-list>

如果我用鼠标中键单击链接,链接将工作并打开另一个选项卡,但我无法用鼠标左键打开链接


我尝试了class=“link overlapping”,但仍然不起作用。

您尝试过routerLink吗?它对我有用

  <mat-chip-list class="categories">
      <mat-chip><a [routerLink]="['/your_path']">{{ data }} </a></mat-chip>
    </mat-chip-list>
  </div>

{{data}}

您尝试过routerLink吗?它对我有用

  <mat-chip-list class="categories">
      <mat-chip><a [routerLink]="['/your_path']">{{ data }} </a></mat-chip>
    </mat-chip-list>
  </div>

{{data}}

您根本不需要锚,只需直接在
mat芯片上使用
routerLink

<mat-chip-list class="categories">
  <mat-chip [routerLink]="['publication/category', category.id]">
    {{category.name}}
  </mat-chip>
</mat-chip-list>

{{category.name}

您根本不需要锚,只需直接在
mat芯片上使用
routerLink

<mat-chip-list class="categories">
  <mat-chip [routerLink]="['publication/category', category.id]">
    {{category.name}}
  </mat-chip>
</mat-chip-list>

{{category.name}

外部链接如何?路由器不支持外部链接。你需要一个带有
href
的锚。有没有一种简单的方法将标签设计成芯片?外部链接呢?路由器不用于外部链接。您需要一个带有
href
的锚。有没有一种简单的方法可以将标签样式设置为芯片?