Cloud-CV/EvalAI

View on GitHub
frontend_v2/src/app/components/challenge/challengeoverview/challengeoverview.component.ts

Summary

Maintainability
A
2 hrs
Test Coverage
import { Component, OnInit } from '@angular/core';

// import service
import { ChallengeService } from '../../../services/challenge.service';

/**
 * Component Class
 */
@Component({
  selector: 'app-challengeoverview',
  templateUrl: './challengeoverview.component.html',
  styleUrls: ['./challengeoverview.component.scss'],
})
export class ChallengeoverviewComponent implements OnInit {
  /**
   * Challenge object
   */
  challenge: any = null;

  /**
   * Is challenge host
   */
  isChallengeHost = false;

  /**
   * Constructor.
   * @param challengeService  ChallengeService Injection.
   */
  constructor(private challengeService: ChallengeService) {}

  /**
   * Component on initialized.
   */
  ngOnInit() {
    this.challengeService.currentChallenge.subscribe((challenge) => {
      this.challenge = challenge;
    });
    this.challengeService.isChallengeHost.subscribe((status) => {
      this.isChallengeHost = status;
    });
  }
}