import {Component, Input} from '@angular/core'; import {ErrorCodes} from './properties/openaireProperties'; @Component({ selector: 'errorMessages', template: ` ` }) export class ErrorMessagesComponent { @Input() status: Array; @Input() type: string; public errorCodes:ErrorCodes; constructor () {} ngOnInit() { this.errorCodes = new ErrorCodes(); console.info("ngOnInit"); if(!this.status) { this.status = [this.errorCodes.LOADING]; } } ngOnDestroy() {} public checkErroCode(code: number) { return function(status: number) { return (status == code); } } }