source: src/Clients/Angular/finki-chattery/src/app/shared-app/components/generic/header/header.component.ts

dev
Last change on this file was 6738cc0, checked in by Стојков Марко <mst@…>, 2 years ago

Added notifications

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import { Component, OnInit } from '@angular/core';
2import { Router } from '@angular/router';
3import { AuthService } from 'src/app/core/services';
4import { ButtonType } from '../button/button.models';
5
6@Component({
7 selector: 'app-header',
8 templateUrl: './header.component.html',
9 styleUrls: ['./header.component.scss']
10})
11export class HeaderComponent implements OnInit {
12 ButtonType = ButtonType;
13
14 public studentCheckedNotifications = false;
15
16 constructor(public auth: AuthService, private router: Router) {}
17
18 ngOnInit(): void {}
19
20 logout(): void {
21 this.auth.logout();
22 }
23
24 askQuestion(): void {
25 this.router.navigateByUrl('questioning/ask');
26 }
27
28 navigateFromLogo(): void {
29 if (this.auth.isStudent()) {
30 this.router.navigateByUrl('questioning/preview');
31 }
32 if (this.auth.isModerator()) {
33 this.router.navigateByUrl('moderating/categories');
34 }
35 }
36
37 goToQuestion(questionUid: string): void {
38 this.router.navigateByUrl(`questioning/${questionUid}`);
39 }
40
41 studentCheckedNotificationsClick(): void {
42 if (!this.studentCheckedNotifications) {
43 this.auth.studentCheckedNotifications().subscribe();
44 }
45 this.studentCheckedNotifications = true;
46 }
47}
Note: See TracBrowser for help on using the repository browser.