Created
September 5, 2019 18:48
-
-
Save jsinglet/4dd013faf3ca1137c63e1800c14f4188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, HostBinding } from "@angular/core"; | |
import { Tenant, TenantService } from './tenant/tenant.service'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css', './app.component.skins.less'] | |
}) | |
export class AppComponent implements OnInit { | |
title = 'multi-tenant-angular'; | |
constructor(private tenantService: TenantService){ | |
} | |
@HostBinding("class.theme-client1") public client1Theme: boolean; | |
@HostBinding("class.theme-client2") public client2Theme: boolean; | |
ngOnInit() { | |
this.enableThemes(); | |
} | |
enableThemes() { | |
this.client1Theme = this.tenantService.getTenant() === Tenant.CLIENT1; | |
this.client2Theme = this.tenantService.getTenant() === Tenant.CLIENT2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment