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
`
})
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);
}
}
}