File

src/app/app.component.ts

Description

Root component

Implements

OnInit

Example

Metadata

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

Index

Properties
Methods

Constructor

constructor(mdbSpinningPreloader: MDBSpinningPreloader, translate: TranslateService)

Constructor

Parameters :
Name Type Optional Description
mdbSpinningPreloader MDBSpinningPreloader

MDB Spinning Preloader

translate TranslateService

Translate Service

Methods

ngOnInit
ngOnInit()

Initialioze component

Returns : void

Properties

Private log
log:
Default value : Log.create('AppComponent')

Logger

import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import * as localforage from 'localforage';
import { MDBSpinningPreloader } from 'ng-mdb-pro';
import { Log } from 'ng2-logger';

/**
 * Root component
 * @author Daniel Sogl
 */
@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss']
})
export class AppComponent implements OnInit {
  /** Logger */
  private log = Log.create('AppComponent');

  /**
   * Constructor
   * @param  {MDBSpinningPreloader} mdbSpinningPreloader MDB Spinning Preloader
   * @param  {TranslateService} translate Translate Service
   */
  constructor(
    private mdbSpinningPreloader: MDBSpinningPreloader,
    translate: TranslateService
  ) {
    translate.setDefaultLang('en');
    translate.use(translate.getBrowserLang());
  }

  /**
   * Initialioze component
   */
  ngOnInit() {
    this.log.color = 'orange';
    this.log.d('Component initialized');
    this.mdbSpinningPreloader.stop();

    localforage.config({
      driver: localforage.WEBSQL,
      name: 'eventpicking',
      version: 1.0,
      size: 4980736,
      storeName: '_eventpicking',
      description: 'some description'
    });
  }
}
<app-navigation-bar></app-navigation-bar>


<main>
  <div class="container">
    <router-outlet></router-outlet>
  </div>
</main>
<br>
<br>
<br>
<!--Main Layout-->
<app-footer></app-footer>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""