Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 9c7b1b63

Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)

Re #7462 Dashboard connected to GET methods of REST API

Zobrazit rozdíly:

webapp/src/app/header/header.component.ts
1 1
import { Component, Input } from '@angular/core';
2 2
import { MatDialog } from '@angular/material';
3 3
import { ProfileSettingsComponent } from '../profile-settings/profile-settings.component';
4
import { ProfileService } from '../services/profile.service';
5
import { UserProfile } from '../models/user-profile.model';
4 6

  
5 7
@Component({
6 8
  selector: 'app-header',
......
10 12
export class HeaderComponent {
11 13
  @Input() name = 'John Doe';
12 14

  
13
  constructor(private dialog: MatDialog) { }
15
  private notificationSettings: Date;
16

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

  
15 25
  onProfileClick(): void {
16 26
    this.dialog.open(ProfileSettingsComponent, {
17 27
      data: {
28
        shouldNotify: this.notificationSettings, // TODO potřeba?
29
        notifyDate: this.notificationSettings,
30
        notifyTime: {
31
          hour: this.notificationSettings.getHours(),
32
          minute: this.notificationSettings.getMinutes()
33
        }
18 34
      }
19 35
    });
20 36
  }

Také k dispozici: Unified diff