码迷,mamicode.com
首页 > 其他好文 > 详细

angular 组件跳转组件 并传参数

时间:2018-09-11 21:30:06      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:技术分享   hot   person   lin   angular   out   技术   路由   dep   

技术分享图片

<button class="btn-link" routerLink="/deposits" [queryParams]="{currencyId:personalAssets.currency_id}">{{‘personal-assets.Deposit‘|translate}}</button>

[queryParams]="{currencyId:personalAssets.currency_id}
将你需要的参数传输过去

技术分享图片

在另一个组件中接收

this.currencyId = this._activatedRoute.snapshot.queryParams[‘currencyId‘];

导入angluar路由服务 然后接收传来的参数

angular 组件跳转组件 并传参数

标签:技术分享   hot   person   lin   angular   out   技术   路由   dep   

原文地址:https://www.cnblogs.com/king94Boy/p/9629729.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!