import { Component, Injector, OnInit, ViewChild } from '@angular/core'; import { AppComponentBase } from '@shared/common/app-component-base'; import { AccountServiceProxy } from '@shared/service-proxies/service-proxies'; import { TenantChangeModalComponent } from './tenant-change-modal.component'; @Component({ selector: 'tenant-change', template: ` {{"CurrentTenant" | localize}}: {{tenancyName}} {{"NotSelected" | localize}} ({{l("Change")}}) ` }) export class TenantChangeComponent extends AppComponentBase implements OnInit { @ViewChild('tenantChangeModal', {static: false}) tenantChangeModal: TenantChangeModalComponent; tenancyName: string; name: string; constructor( injector: Injector, private _accountService: AccountServiceProxy ) { super(injector); } ngOnInit() { if (this.appSession.tenant) { this.tenancyName = this.appSession.tenant.tenancyName; this.name = this.appSession.tenant.name; } } get isMultiTenancyEnabled(): boolean { return abp.multiTenancy.isEnabled; } showChangeModal(): void { this.tenantChangeModal.show(this.tenancyName); } }