src/app/app.component.ts
Root component
selector | app-root |
styleUrls | app.component.scss |
templateUrl | app.component.html |
Properties |
|
Methods |
constructor(mdbSpinningPreloader: MDBSpinningPreloader, translate: TranslateService)
|
||||||||||||
Defined in src/app/app.component.ts:18
|
||||||||||||
Constructor
Parameters :
|
ngOnInit |
ngOnInit()
|
Defined in src/app/app.component.ts:36
|
Initialioze component
Returns :
void
|
Private log |
log:
|
Default value : Log.create('AppComponent')
|
Defined in src/app/app.component.ts:18
|
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>