File

src/app/app.component.ts

Description

Главный компонент для главного модуля

Implements

OnInit

Metadata

selector app-root
styleUrls app.component.scss
templateUrl ./app.component.html

Index

Properties
Methods

Constructor

constructor(settingsService: SettingsService)

Конструктор

Parameters :
Name Type Description
settingsService SettingsService

Сервис настроек

Methods

ngOnInit
ngOnInit()

Получение общих настроек

Returns : void

Properties

environment
environment: any
Type : any
Default value : environment

Получение переменных окружения

import { Component, OnInit } from '@angular/core';
import { environment } from '../environments/environment';
import { SettingsService } from 'glx.ui/components/kernel/services/settings.service';

/**
 * Главный компонент для главного модуля
 */
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  /**
   * Получение переменных окружения
   * @type {{production: boolean; hmr: boolean; version}} Окружение
   */
  environment: any = environment;

  /**
   * Конструктор
   * @param {SettingsService} settingsService Сервис настроек
   */
  constructor(private settingsService: SettingsService) {

  }

  /**
   * Получение общих настроек
   */
  ngOnInit() {
    this.settingsService.getSection('common');
  }
}
<div class="main-area">
  <router-outlet></router-outlet>
</div>
<div class="version">
  v{{environment.version}}
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""