Projekt

Obecné

Profil

Stáhnout (1.18 KB) Statistiky
| Větev: | Tag: | Revize:
1
import {Component, Input} from '@angular/core';
2
import {MatDialog} from '@angular/material';
3
import {ProfileSettingsComponent} from '../profile-settings/profile-settings.component';
4
import {ProfileService} from '../services/profile.service';
5
import {LocalizationService} from '../localization/localization.service';
6

    
7
@Component({
8
  selector: 'app-header',
9
  templateUrl: './header.component.html',
10
  styleUrls: ['./header.component.sass']
11
})
12
export class HeaderComponent {
13
  @Input() name = 'John Doe';
14

    
15
  private notificationSettings: Date;
16

    
17
  constructor(
18
    private dialog: MatDialog,
19
    private profileService: ProfileService,
20
    private localizationService: LocalizationService
21
    ) {
22
    // profileService.getProfile()
23
    //   .subscribe((data: UserProfile) => this.notificationSettings = new Date(data.settings.notification));
24
  }
25

    
26
  onProfileClick(): void {
27
    this.dialog.open(ProfileSettingsComponent, {
28
      data: {
29
        shouldNotify: this.notificationSettings, // TODO potřeba?
30
        notifyDate: this.notificationSettings,
31
        notifyTime: {
32
          hour: this.notificationSettings.getHours(),
33
          minute: this.notificationSettings.getMinutes()
34
        }
35
      }
36
    });
37
  }
38
}
(3-3/3)