Skip to content

Instantly share code, notes, and snippets.

@jsinglet
Created September 5, 2019 18:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsinglet/4dd013faf3ca1137c63e1800c14f4188 to your computer and use it in GitHub Desktop.
Save jsinglet/4dd013faf3ca1137c63e1800c14f4188 to your computer and use it in GitHub Desktop.
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