projects/common/lib/models/error-message.interface.ts
Properties |
|
[key: string]:
|
required |
required:
|
Type : string
|
Optional |
export const LabelReplacementTag = '{label}';
export interface ErrorMessage {
required?: string;
[key: string]: string;
}
// To catch all occurances of the label tag in the message
const regExpLabel = new RegExp( LabelReplacementTag, 'g' );
// Function only used with library
export function replaceLabelTag( str: string, value: string ) {
return str.replace( regExpLabel, value );
}