Skip to content

Instantly share code, notes, and snippets.

@gandra
Created February 8, 2017 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gandra/9568daccd306faa6b59b7a06c11c5efc to your computer and use it in GitHub Desktop.
Save gandra/9568daccd306faa6b59b7a06c11c5efc to your computer and use it in GitHub Desktop.
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