Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
app.component.ts
import { Component, ViewChild, OnInit, ElementRef, HostBinding } from '@angular/core';
import { environment } from '../environments/environment';
import { MenuComponent } from './menu';
import { LoginService, EstiloService, UtilService } from './comun/services';
import { KeycloakService } from './comun/keycloak';
import * as moment from 'moment/moment';
import { enableProdMode } from '@angular/core';
if (environment.production) {
enableProdMode();
}
@Component({
selector: 'body',
templateUrl: './app.component.min.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
@HostBinding('class')
public cssClass:string = '';
title = 'app works!';
env: any;
clase: string = 'skin-blue'
today: string = moment().format('D MMM YYYY');
claseGeneral = 'skin-blue sidebar-mini sidebar-collapse';
@ViewChild('mimenu')
allll: MenuComponent;
showMenu: boolean = false;
inicio: Date = new Date(1480536085);
termino: Date = new Date(1480554085);
constructor(
public utilService: UtilService,
private loginService: LoginService,
private el: ElementRef,
private css: EstiloService,
public kc: KeycloakService
){
this.env = environment;
}
ngOnInit(): void {
this.cssClass = this.css.cssClass;
}
public isLogeado():boolean{
return this.loginService.getLogeado();
}
public isPerfilRequerido(): boolean {
return ( this.isLogeado() && this.loginService.getUsuarioActivo() && this.loginService.getUsuarioActivo().perfil == 'full' );
}
public cambioSkin(_skin: string): void {
this.cssClass = this.css.cssClass;
}
public cambioComportamiento(evento): void {
this.css.openClose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.