All files / src/app app.component.ts

93.75% Statements 15/16
80% Branches 8/10
80% Functions 4/5
92.31% Lines 12/13

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 355x 5x   5x   5x                               5x 1x   1x   5x 4x     5x 2x   5x  
import { Component } from '@angular/core';
import { Router } from '@angular/router';
 
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) {}
 
  isLoginActive() {
    return this.router.url === '/login' || !this.authStorageService.isLoggedIn();
  }
 
  isDashboardPage() {
    return this.router.url === '/dashboard';
  }
}