File

src/client/app/components/about/about.component.ts

Implements

OnInit AfterViewInit

Metadata

moduleId module.id
selector sd-about
styleUrls about.component.css
templateUrl about.component.html

Index

Properties
Methods

Constructor

constructor(_appService: AppService, injector: Injector)

Methods

Private _calcHeight
_calcHeight()
Returns : void
ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnInit
ngOnInit()
Returns : void
onWindowResize
onWindowResize(event: any)
Returns : void

Properties

Private _page
_page: any
Type : any
el
el: ElementRef
Type : ElementRef
Decorators : ViewChild
height
height: number
Type : number
Private page
page:
timeOut
timeOut: any
Type : any
import {Injector, Component, OnInit, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import {AppService} from '../../modules/core/services/index';
import {Config} from '../../modules/core/index';

@Component({
  moduleId: module.id,
  selector: 'sd-about',
  templateUrl: 'about.component.html',
  styleUrls: [
    'about.component.css',
  ],
})
export class AboutComponent implements OnInit, AfterViewInit {

  @ViewChild('el') el: ElementRef;
  height: number;
  timeOut: any;


  private _page: any;
  private get page() {
    if (Config.PageClass) {
      if (!this._page) {
        this._page = this.injector.get(Config.PageClass);
      }

      return this._page;
    }
  }

  constructor(private _appService: AppService,
    private injector: Injector) {
  }

  ngOnInit() {
    if (typeof document === 'object' && document.title) {
      document.title = 'About';
      this._calcHeight();
    }
  }


  ngAfterViewInit(): void {
    this._appService.isPreloader = false;
  }

  onWindowResize(event: any) {
    if (this.timeOut) {
      window.clearTimeout(this.timeOut);
    }
    this.timeOut = window.setTimeout(() => {
      this._calcHeight();
    }, 64);
  }

  private _calcHeight() {
    if (typeof document === 'object' && document.title) {
      this.height = this.el.nativeElement.offsetParent.offsetHeight - (48 * 2) - 16;
    }
  }


}
<div #el  [ngStyle]="{'height': height + 'px'}" (resize)="onWindowResize($event)">
  <p>{{'ABOUT_CONTENT_1' | translate}}<a href='http://www.enipuzzles.com/' target='_blank'>Eni Puzzle</a>{{'ABOUT_CONTENT_2' | translate}}
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""