路由到不同的路由

时间:2018-04-12 17:14:00

标签: angular routing

我在Angular 4应用程序中使用路由器链接并尝试路由到以下

[routerLink]="['/CostofOwnership/ownership-result', cons.name]

但是这是它转到

的网址

http://localhost:4200/?changeName=Cost+of+a+new+valve&default=7000&changeName=Cost+of+a+new+actuator+assembly&default=3000&changeName=Cost+to+repair+the+valve+%28Repair+kit+and+labour%29&default=1800&changeName=Cost+to+remove+and+re-install+the+valve&default=5000&changeName=Cost+to+generate+a+purchase+order&default=350&changeName=Cost+to+decontaminate+a+valve+that+has+been+in+service&default=450&changeName=Cost+of+packaging+and+shipping+the+valve&default=900&changeName=Cost+to+test+a+new%2Frepaired+valve+before+it+is+installed&default=65&changeName=Cost+of+storage+for+spare+valves%2Frepair+kits&default=40&changeName=Cost+to+insulate+the+valve&default=450&changeName=Cost+of+an+unscheduled+shutdown&default=0#/CostofOwnership/ownership-result/Default

为什么在开头添加巨大的字符串?

编辑:

const routes: Routes = [
  {
    path: '',
    data: {
      title: 'ownership-cost'
    },
    children: [
      {
        path: 'ownership-result-compare',
        component: OwnershipResultCompareComponent,
        data: {
          title: 'Ownership-Form'
        }
      },
      {
        path: 'ownership-form/:typeOf',
        component: OwnershipFormComponent,
        data: {
          title: 'Ownership-Form'
        }
      },
      {
        path: 'ownership-form-admin/:uid/:typeOf',
        component: OwnershipAdminComponent,
        data: {
          title: 'Ownership-Form-Admin'
        }
      },
      {
        path: 'ownership-result/:typeOf',
        component: OwnershipResultComponent,
        data: {
          title: 'Ownership-Result'
        }
      },
      {
        path: 'ownership-result-admin/:uid/:typeOf',
        component: OwnershipResultAdminComponent,
        data: {
          title: 'Ownership-Result-Admin'
        }
      },
      {
        path: 'ownership-question',
        component: OwnershipQuestionComponent,
        data: {
          title: 'Ownership-Question'
        }
      },
      {
        path: 'ownership-inform',
        component: OwnershipInformComponent,
        data: {
          title: 'Ownership-Information'
        }
      },
    ]
  }
]

0 个答案:

没有答案