File

app/app.component.ts

Implements

OnInit

Metadata

encapsulation ViewEncapsulation.None
selector div[app-root]
template
<router-outlet></router-outlet>
<app-content-json *ngIf="isDevEnv"></app-content-json>

Index

Properties
Methods

Constructor

constructor(publicationService: PublicationService)
Parameters :
Name Type Optional
publicationService PublicationService No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

Public isDevEnv
Type : boolean
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);

	}
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""