All files / src/app/components/empty-placeholder empty-placeholder.component.ts

100% Statements 10/10
66.66% Branches 4/6
100% Functions 4/4
100% Lines 9/9

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                  60x   1x   1x     1x 1x 1x 1x 1x   1x                
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, RouterLink } from '@angular/router';
 
@Component({
    selector: 'app-empty-placeholder',
    imports: [RouterLink],
    templateUrl: './empty-placeholder.component.html',
    styleUrl: './empty-placeholder.component.scss'
})
export class EmptyPlaceholderComponent implements OnInit{
 
    ressourceName: string = "data";
 
    constructor(private route: ActivatedRoute){}
 
    ngOnInit(){
        this.route.url.subscribe(urlSegments => {
            let segment = urlSegments[0].path;
            Eif (segment !== undefined){
              Eif (segment.endsWith('s')){
                segment = segment.slice(0, -1);
              }
              this.ressourceName = segment.charAt(0).toUpperCase() + segment.slice(1);
            }
          });
    }
 
 
 
}