Angular卡片导航问题

问题描述 投票:0回答:2

enter image description here

当我点击整张卡时,应该导航到项目详细组件,然后当我点击BID RECEIVED按钮时,应该导航到投标组件,但它导航到项目详细页面。

<div class="card" *ngFor="let data of projectdata">
   <div class="card-body" routerLink="/projectdetail/{{data._id}}">
      <div class="bids" routerLink='/bids/5edbd6eb3290c300179cc2f9'>{{data.totalBids}} BIDS RECEIVED</div>
   </div>
</div>
angular ionic-framework ionic4
2个回答
-1
投票

试试 $event.stopPropagation() 在你 BIDS Received 按钮。

<div class="card" *ngFor="let data of projectdata">
   <div class="card-body" routerLink="/projectdetail/{{data._id}}">
      <div class="bids" routerLink='/bids/5edbd6eb3290c300179cc2f9'
         (click)="$event.stopPropagation()">{{data.totalBids}} BIDS RECEIVED</div>
   </div>
</div>
© www.soinside.com 2019 - 2024. All rights reserved.