app/app.component.ts
encapsulation | ViewEncapsulation.None |
selector | div[app-root] |
template |
|
Properties |
|
Methods |
constructor(publicationService: PublicationService)
|
||||||
Defined in app/app.component.ts:16
|
||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Defined in app/app.component.ts:21
|
Returns :
void
|
Public isDevEnv |
Type : boolean
|
Defined in app/app.component.ts:16
|
import { Component, OnInit } from '@angular/core';
import { ViewEncapsulation } from '@angular/core';
import { AppConfig } from './app.config';
import { PublicationService } from './core/services/publication-service/publication.service';
@Component({
selector: 'div[app-root]',
template: `
<router-outlet></router-outlet>
<app-content-json *ngIf="isDevEnv"></app-content-json>
`,
encapsulation: ViewEncapsulation.None,
})
export class AppComponent implements OnInit {
public isDevEnv: boolean;
constructor(
private publicationService: PublicationService // Needs to be initialized at start.
) {}
ngOnInit(): void {
this.isDevEnv = 'dev' === AppConfig.settings.env.name;
// Load font awesome icons
const cssLink = document.createElement('link');
cssLink.rel = 'stylesheet';
cssLink.href = 'https://use.fontawesome.com/releases/v5.3.1/css/all.css';
document.head.appendChild(cssLink);
}
}