File

src/app/modules/profile/contracts/contracts.ts

Description

Просмотр договоров в одном окне

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

Implements

OnInit

Metadata

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

Index

Properties
Methods

Constructor

constructor(commonService: CommonService)

Конструктор

Parameters :
Name Type Description
commonService CommonService

Methods

ngOnInit
ngOnInit()

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

Returns : void

Properties

contracts
contracts: any
Type : any

Договоры

header
header: string
Type : string
Default value : Договоры

Заголовок

loading
loading: boolean
Type : boolean

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

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

/**
 * Просмотр договоров в одном окне
 *
 * (устаревший)
 */
@Component({
  selector: 'profile-contracts',
  templateUrl: './contracts.html',
  styleUrls: ['./contracts.scss']
})
export class ProfileContractsComponent implements OnInit {
  /**
   * Заголовок
   * @type {string}
   */
  header: string = 'Договоры';
  /**
   * Договоры
   */
  contracts: any;
  /**
   * Индикатор загрузки основных данных
   * @type {boolean}
   */
  loading: boolean;

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

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

    this.commonService.get('contracts')
      .subscribe(
        data => {
          this.contracts = 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="contracts-wrapper">
  <glx-loading-banner [loading]="loading" [svg]="true" text="Подождите, идет загрузка..."></glx-loading-banner>
  <glx-contracts-viewer [contracts]="contracts" *ngIf="!loading && contracts"></glx-contracts-viewer>
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""