import {Component, Input} from '@angular/core'; import {ErrorCodes} from './properties/errorCodes'; @Component({ selector: 'errorMessages', template: `
No {{type}} available
An Error Occured
Service temprorarily unavailable. Please try again later.
No {{type}} found
Requested page out of bounds
Changes could not be saved
You are not allowed to access this page
` }) export class ErrorMessagesComponent { @Input() status: Array; @Input() type: string; @Input() tab_error_class: boolean = false; 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); } } }