我尝试将this Angular App切换到ASP.NET Core Angular 2 App,但我遇到RouteSegment
和RouteTree
的问题。
关注导入:
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的替代方法是什么?