All files / src/app app.component.ts

95% Statements 19/20
76.47% Branches 13/17
75% Functions 3/4
94.44% Lines 17/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 435x 5x   5x 5x   5x                               5x 1x     1x 1x 1x 1x   1x     5x 4x     5x 2x   5x  
import { Component, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
 
import { ToastsManager } from 'ng2-toastr';
import { TooltipConfig } from 'ngx-bootstrap/tooltip';
 
import { AuthStorageService } from './shared/services/auth-storage.service';
 
@Component({
  selector: 'cd-root',
  template: require('./app.component.html'),
  styles: [],
  providers: [
    {
      provide: TooltipConfig,
      useFactory: (): TooltipConfig =>
        Object.assign(new TooltipConfig(), {
          container: 'body'
        })
    }
  ]
})
export class AppComponent {
  title = 'cd';
 
  constructor(
    private authStorageService: AuthStorageService,
    private router: Router,
    public toastr: ToastsManager,
    private vcr: ViewContainerRef
  ) {
    this.toastr.setRootViewContainerRef(this.vcr);
  }
 
  isLoginActive() {
    return this.router.url === '/login' || !this.authStorageService.isLoggedIn();
  }
 
  isDashboardPage() {
    return this.router.url === '/dashboard';
  }
}