Browse Source

docs: fix patch/remove route example

pull/4533/head
Arman Ozak 6 years ago
parent
commit
6963aa73b3
  1. 21
      docs/en/UI/Angular/Modifying-the-Menu.md

21
docs/en/UI/Angular/Modifying-the-Menu.md

@ -183,15 +183,13 @@ The `patch` method of `RoutesService` finds a route by its name and replaces its
// this.routes is instance of RoutesService // this.routes is instance of RoutesService
// eThemeSharedRouteNames enum can be imported from @abp/ng.theme.shared // eThemeSharedRouteNames enum can be imported from @abp/ng.theme.shared
this.routes.add([ const dashboardRouteConfig: ABP.Route = {
{ path: '/dashboard',
path: '/dashboard', name: '::Menu:Dashboard',
name: '::Menu:Dashboard', parentName: '::Menu:Home',
parentName: '::Menu:Home', order: 1,
order: 1, layout: eLayoutType.application,
layout: eLayoutType.application, };
},
])
const newHomeRouteConfig: Partial<ABP.Route> = { const newHomeRouteConfig: Partial<ABP.Route> = {
iconClass: 'fas fa-home', iconClass: 'fas fa-home',
@ -199,10 +197,9 @@ const newHomeRouteConfig: Partial<ABP.Route> = {
order: 0, order: 0,
}; };
const new DashboardRouteConfig: this.routes.add([dashboardRouteConfig]);
this.routes.patch('::Menu:Home', newHomeRouteConfig); this.routes.patch('::Menu:Home', newHomeRouteConfig);
this.routes.remove('Your navigation', newHomeRouteConfig); this.routes.remove(['Your navigation']);
``` ```
- Moved the _Home_ navigation under the _Administration_ dropdown based on given `parentName`. - Moved the _Home_ navigation under the _Administration_ dropdown based on given `parentName`.

Loading…
Cancel
Save