From 6b4257033a2f55f949c7630aafbc3ffc969084a2 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 7 Jul 2020 17:12:26 +0300 Subject: [PATCH] docs: remove route patching and adding topics from Config-State.md --- docs/en/UI/Angular/Config-State.md | 71 ------------------------------ 1 file changed, 71 deletions(-) diff --git a/docs/en/UI/Angular/Config-State.md b/docs/en/UI/Angular/Config-State.md index 71a5da01f0..089697f064 100644 --- a/docs/en/UI/Angular/Config-State.md +++ b/docs/en/UI/Angular/Config-State.md @@ -201,77 +201,6 @@ this.config.dispatchGetAppConfiguration(); Note that **you do not have to call this method at application initiation**, because the application configuration is already being received from the server at start. -### How to Patch Route Configuration - -The `dispatchPatchRouteByName` finds a route by its name and replaces its configuration in the `Store` with the new configuration passed as the second parameter. - -```js -// this.config is instance of ConfigStateService - -const newRouteConfig: Partial = { - name: "Home", - path: "home", - children: [ - { - name: "Dashboard", - path: "dashboard" - } - ] -}; - -this.config.dispatchPatchRouteByName("::Menu:Home", newRouteConfig); -// returns a state stream which emits after dispatch action is complete -``` - -### How to Add a New Route Configuration - -The `dispatchAddRoute` adds a new route to the configuration state in the `Store`. For this, the route config should be passed as the parameter of the method. - -```js -// this.config is instance of ConfigStateService - -const newRoute: ABP.Route = { - name: "My New Page", - iconClass: "fa fa-dashboard", - path: "page", - invisible: false, - order: 2, - requiredPolicy: "MyProjectName.MyNewPage" -}; - -this.config.dispatchAddRoute(newRoute); -// returns a state stream which emits after dispatch action is complete -``` - -The `newRoute` will be placed as at root level, i.e. without any parent routes and its url will be stored as `'/path'`. - -If you want **to add a child route, you can do this:** - -```js -import { eIdentityRouteNames } from '@abp/ng.identity'; - -// this.config is instance of ConfigStateService - -const newRoute: ABP.Route = { - parentName: eIdentityRouteNames.IdentityManagement, - name: "My New Page", - iconClass: "fa fa-dashboard", - path: "page", - invisible: false, - order: 2, - requiredPolicy: "MyProjectName.MyNewPage" -}; - -this.config.dispatchAddRoute(newRoute); -// returns a state stream which emits after dispatch action is complete -``` - -The `newRoute` will then be placed as a child of the parent route named `eIdentityRouteNames.IdentityManagement` and its url will be set as `'/identity/page'`. - -#### Route Configuration Properties - -Please refer to `ABP.Route` type for all the properties you can pass to `dispatchSetEnvironment` in its parameter. It can be found in the [common.ts file](https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/models/common.ts#L27). - ### How to Set the Environment The `dispatchSetEnvironment` places environment variables passed to it in the `Store` under the configuration state. Here is how it is used: