All files / app/shared/components/locale locale.component.ts

100% Statements 13/13
100% Branches 0/0
100% Functions 1/1
100% Lines 11/11

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 322x 2x 2x 2x 2x 2x                           2x   8x   8x 8x     1x        
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { LocaleService } from './locale.service';
import { CommonModule } from '@angular/common';
 
@Component({
  selector: 'cmx-locale',
  imports: [
    CommonModule,
    MatIconModule,
    MatButtonModule,
    MatMenuModule,
  ],
  templateUrl: './locale.component.html',
  styleUrl: './locale.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class LocaleComponent {
 
  private _service = inject(LocaleService);
 
  public locale = this._service.locale;
  public locales = this._service.locales;
 
  public changeLocale(locale: string) {
    this._service.changeLocale(locale);
  }
 
}