The *inputError directive defined in The inputError directive subsection of Chapter 12, Angular Advanced Features, uses a predefined table of standard error messages, placed in a static property of the same directive class. As discussed at the beginning of this section, sharing a resource through a static property is not a best practice. DI should always be preferred to share resources. As a side effect of using DI for injecting the errors table, each application configuration may use a different version of the table that is localized for the language chosen for that configuration. Application localization is discussed in the Application localization section of Chapter 11, Input and Interactions, while application ...
Injecting localized error messages
Get Hands-On TypeScript for C# and .NET Core Developers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.