Created
April 26, 2024 13:04
-
-
Save elmarputz/62d87674579856e1de18bc8d462f18f1 to your computer and use it in GitHub Desktop.
error messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ErrorMessage { | |
constructor( | |
public forControl: string, | |
public forValidator: string, | |
public text: string | |
) { } | |
} | |
export const BookFormErrorMessages = [ | |
new ErrorMessage('title', 'required', 'Ein Buchtitel muss angegeben werden'), | |
new ErrorMessage('isbn', 'required', 'Es muss eine ISBN angegeben werden'), | |
new ErrorMessage('isbn', 'minlength', 'Die ISBN muss mindestens 10 Zeichen enthalten'), | |
new ErrorMessage('isbn', 'maxlength', 'Eine ISBN darf höchstens 13 Zeichen haben'), | |
new ErrorMessage('published', 'required', 'Es muss ein Erscheinungsdatum angegeben werden'), | |
new ErrorMessage('authors', 'required', 'Es muss ein Autor angegeben werden'), | |
new ErrorMessage('rating', 'min', 'Bewertung kann nur positive Werte annehmen'), | |
new ErrorMessage('rating', 'max', 'Maximal 10 Sterne erlaubt') | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment