[英]to send data with NavigateByUrl of Angular 7
I would like to know if it is possible to send data via navigateByUrl of Angular 7. I do not know if it is possible because I found little information about it. 我想知道是否可以通过Angular 7的navigationByUrl发送数据。我不知道是否可以,因为我发现的信息很少。 What I want to do is this: Send my selected client ID variable after clicking Enter in my TR(line of the table that is receiving focus). 我要执行的操作是:在TR(正在接收焦点的表的行)中单击Enter,然后发送我选择的客户端ID变量。 This through NavegateByUrl, is it possible? 通过NavegateByUrl可以吗?
My line: 我的台词:
<tr (keyup.enter)="customerSelected(selectedCustomer)">
My code: 我的代码:
customerSelected(customer_id){
this.selectedCustomer = customer_id;
this.router.navigateByUrl('cadastro/selectedCustomer'); //to send variable, how?
}
My method is wrong, I know. 我知道我的方法是错误的。 But how is the correct way to send my variable through NavigateByUrl? 但是如何通过NavigateByUrl发送变量的正确方法呢?
Does anyone have any ideas for this? 有人对此有任何想法吗? If you have one, thank you in advance. 如果您有一个,请先谢谢。 If the question was not explicit, comment. 如果问题不明确,请发表评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.