Angular 2 Fullversion,RouteSegment和RouteTree替代方案?

时间:2016-10-07 14:51:58

标签: javascript angular asp.net-core router

我尝试将this Angular App切换到ASP.NET Core Angular 2 App,但我遇到RouteSegmentRouteTree的问题。

关注导入:

Import { RouteConfig, ROUTER_DIRECTIVES, RouterSegment, OnActivate, RouteTree } from 'angluar2/router';

跟随路由器:

routerOnActivate(current: RouteSegment, prev?: RouteSegment,
    currTree?: RouteTree, prevTree?: RouteTree) {
    var path = currTree.children(current)[0].stringifiedUrlSegments;
    switch (path) {
      case 'details':
        this.displayMode = CustomerDisplayModeEnum.Details;
        break;
      case 'orders':
        this.displayMode = CustomerDisplayModeEnum.Orders;
        break;
      case 'edit':
        this.displayMode = CustomerDisplayModeEnum.Edit;
        break;
    }
  }

RouteSegment和RouteTree的替代方法是什么?

0 个答案:

没有答案