File

src/app/modules/shared/components/app-loader/app-loader.component.ts

Description

loader component

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(resourceService: ResourceService, layoutService: LayoutService, configService: ConfigService)
Parameters :
Name Type Optional
resourceService ResourceService No
layoutService LayoutService No
configService ConfigService No

Inputs

data
Type : ILoaderMessage

Methods

initLayout
initLayout()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

headerMessage
Type : string
layoutConfiguration
Type : any
Public layoutService
Type : LayoutService
loaderMessage
Type : string
Public resourceService
Type : ResourceService
import {Component, OnInit} from '@angular/core';
import {Input} from '@angular/core';
import {ILoaderMessage} from '../../interfaces';
import {ConfigService, LayoutService, ResourceService} from '../../services/index';
import * as _ from 'lodash-es';

/**
 * loader component
 */
@Component({
  selector: 'app-loader',
  templateUrl: './app-loader.component.html',
  styleUrls: ['./app-loader.component.scss']
})
export class AppLoaderComponent implements OnInit {
  @Input() data: ILoaderMessage;
  headerMessage: string;
  loaderMessage: string;
  layoutConfiguration: any;

  constructor(public resourceService: ResourceService, public layoutService: LayoutService,
              private configService: ConfigService) {
    this.resourceService = resourceService;
  }

  initLayout() {
    const layoutType = localStorage.getItem('layoutType') || this.configService.constants.DEFAULT_THEME;
    if (layoutType === this.configService.constants.DEFAULT_THEME) {
      this.layoutConfiguration = this.configService.appConfig.layoutConfiguration;
    }
  }

  ngOnInit() {
    this.initLayout();
    this.headerMessage = _.get(this.resourceService.messages.fmsg, 'm0087');
    this.loaderMessage = _.get(this.resourceService.messages.fmsg, 'm0088');
    if (this.data) {
      this.headerMessage = this.data.headerMessage || this.headerMessage;
      this.loaderMessage = this.data.loaderMessage || this.loaderMessage;
    }
  }

}
<ng-container *ngIf="!layoutConfiguration">
  <div class="ui icon message mt-30">
    <i class="notched circle loading icon"></i>
    <div class="content">
      <div class="header">
        {{headerMessage}}
      </div>
      <p>{{loaderMessage}}</p>
    </div>
  </div>
</ng-container>
<ng-container *ngIf="layoutConfiguration">
  <!--New Layout-->
  <div class="ui icon message mt-30 sbt-app-loader-container">
    <i class="notched circle loading icon"></i>
    <div class="content text-left">
      <div class="header">
        {{headerMessage}}
      </div>
      <p>{{loaderMessage}}</p>
    </div>
  </div>
</ng-container>

./app-loader.component.scss

.sbt-app-loader-container {
    background:var(--sbt-compt-bg);
    width:94% !important;
    margin:0 auto;
    border-radius: 1.5rem;
    border:0px;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""