首页 > 其他 > 详细

[Angular] Do relative routing inside component

时间:2020-02-17 00:45:18      阅读:70      评论:0      收藏:0      [点我收藏+]
onSave(personName) {
    this.person.name = personName;
    this.peopleService.save(this.person).subscribe(() => {
      // redirect back people list
      // this.router.navigateByUrl(‘/people‘);
      this.router.navigate([‘../‘], { relativeTo: this.activatedRoute });
    });
  }

We need to add {relativeTo: xxx}.

[Angular] Do relative routing inside component

原文:https://www.cnblogs.com/Answer1215/p/12319381.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!