RouteParams in Angular 2 rc1

前端 未结 2 1101
名媛妹妹
名媛妹妹 2021-01-05 02:47

I\'ve been trying out Angular 2 since beta, and now with rc.0+ some things have changed.

One of those are RouteParams which cannot be imported from @angular/router.

2条回答
  •  没有蜡笔的小新
    2021-01-05 03:05

    One way is

      routerOnActivate(curr: RouteSegment) {
        this.userName = curr.getParam('userName');
        this.projId = curr.getParam('projId');
      }
    

提交回复
热议问题