2.0.0 • Published 5 years ago
@terminus/ui-validation-messages v2.0.0
Table of Contents
Installation
Packages that need to be installed
@angular/cdk@angular/common@angular/core@angular/flex-layout@angular/forms@angular/material@angular/platform-browser@terminus/design-tokens@terminus/fe-utilities@terminus/ui-pipes@terminus/ui-utilities@terminus/ui-validation-messages@terminus/ui-validatorsdate-fns
Use the ng add command to quickly install all the needed dependencies:
ng add @terminus/ui-validation-messagesModules that need to be in NgModule
TsValidationMessagesModule
CSS imports
In your top level stylesheet, add these imports:
@import '~@terminus/design-tokens/css/library-design-tokens.css';
@import '~@terminus/ui-styles/terminus-ui.css';CSS resources
Load the needed font families by adding this link to the <head> of your application:
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">Usage
This component was initially for internal use, but has been extended to support custom validation messages. Now a custom instance of this component can be passed in to override the existing validation messages.
<ts-validation-messages
<!-- This should be the same FormControl passed to the outer form component -->
[control]="myEmailControl"
<!-- This is the function that will determine the messaging for errors -->
[messagesFactory]="emailMessageFactory"
<!-- This directive is needed to help the parent TsFormField find the custom messages -->
tsCustomValidationMessage
></ts-validation-messages>import { TsValidationMessageFactory } from '@terminus/ui-validation-messages';
...
emailMessageFactory: TsValidationMessageFactory = (a, b) => (a ? 'My custom message!' : null);2.0.0
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
0.0.1
5 years ago