Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import { Component, OnInit, HostBinding } from "@angular/core";
  2. import { Tenant, TenantService } from './tenant/tenant.service';
  3.  
  4. @Component({
  5. selector: 'app-root',
  6. templateUrl: './app.component.html',
  7. styleUrls: ['./app.component.css', './app.component.skins.less']
  8. })
  9. export class AppComponent implements OnInit {
  10.  
  11. title = 'multi-tenant-angular';
  12.  
  13. constructor(private tenantService: TenantService){
  14. }
  15.  
  16. @HostBinding("class.theme-client1") public client1Theme: boolean;
  17. @HostBinding("class.theme-client2") public client2Theme: boolean;
  18.  
  19. ngOnInit() {
  20. this.enableThemes();
  21. }
  22.  
  23. enableThemes() {
  24. this.client1Theme = this.tenantService.getTenant() === Tenant.CLIENT1;
  25. this.client2Theme = this.tenantService.getTenant() === Tenant.CLIENT2;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement