File

src/app/modules/profile/marks/marks.ts

Description

Список оценок

(устаревший)

Implements

OnInit

Metadata

selector profile-marks
styleUrls marks.scss
templateUrl ./marks.html

Index

Properties
Methods

Constructor

constructor(commonService: CommonService)

Конструктор

Parameters :
Name Type Description
commonService CommonService

Methods

ngOnInit
ngOnInit()

Получение данных

Returns : void

Properties

header
header: string
Type : string
Default value : Зачетная книжка

Заголовок

loading
loading: boolean
Type : boolean

Индикатор загрузки основных данных

marks
marks: any
Type : any

Оценки

import { Component, OnInit } from '@angular/core';
import { CommonService } from 'glx.ui/components/kernel/services/common.service';

/**
 * Список оценок
 *
 * (устаревший)
 */
@Component({
  selector: 'profile-marks',
  templateUrl: './marks.html',
  styleUrls: ['./marks.scss']
})
export class ProfileMarksComponent implements OnInit {
  /**
   * Заголовок
   * @type {string}
   */
  header: string = 'Зачетная книжка';
  /**
   * Оценки
   */
  marks: any;
  /**
   * Индикатор загрузки основных данных
   * @type {boolean}
   */
  loading: boolean;

  /**
   * Конструктор
   * @param {CommonService} commonService
   */
  constructor(private commonService: CommonService) {
  }

  /**
   * Получение данных
   */
  ngOnInit() {
    let loaderTimeout = setTimeout(() => {
      this.loading = true;
    }, 200);

    this.commonService.get('marks')
      .subscribe(
        data => {
          this.marks = data;
        },
        error => {
          console.error(error);
        },
        () => {
          clearTimeout(loaderTimeout);
          this.loading = false;
        });

    setTimeout(() => {
      clearTimeout(loaderTimeout);
      this.loading = false;
    }, 10000);
  }

}
<glx-page-title-bx [header]="header"></glx-page-title-bx>
<div class="marks-wrapper">
  <glx-loading-banner [loading]="loading" [svg]="true" text="Подождите, идет загрузка..."></glx-loading-banner>
  <glx-marks-viewer [marks]="marks" *ngIf="!loading && marks"></glx-marks-viewer>
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""