From 8d8917870781bb0ced3e00bb64f3af7ffe30e4bf Mon Sep 17 00:00:00 2001 From: bnymncoskuner Date: Mon, 12 Jul 2021 18:47:52 +0300 Subject: [PATCH] docs: update multi-tenancy docs with tenantKey in angular client --- docs/en/Multi-Tenancy.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/en/Multi-Tenancy.md b/docs/en/Multi-Tenancy.md index 5db646b7a7..f8098a4875 100644 --- a/docs/en/Multi-Tenancy.md +++ b/docs/en/Multi-Tenancy.md @@ -296,6 +296,32 @@ services.Configure(options => }); ```` +If you change the `TenantKey`, make sure to pass it to `CoreModule` in the Angular client as follows: + +```js +@NgModule({ + imports: [ + CoreModule.forRoot({ + // ... + tenantKey: 'MyTenantKey' + }), + ], + // ... +}) +export class AppModule {} +``` + +If you need to access it, you can inject it as follows: + +```js +import { Inject } from '@angular/core'; +import { TENANT_KEY } from '@abp/ng.core'; + +class SomeComponent { + constructor(@Inject(TENANT_KEY) private tenantKey: string) {} +} +``` + > However, we don't suggest to change this value since some clients may assume the the `__tenant` as the parameter name and they might need to manually configure then. ##### Domain/Subdomain Tenant Resolver