light-validate-angular-ui
Angular UI module for working with the light-validate Library. This module provides a directive that controls properties of an html element based on a class with Light Validate mappings, and display error label when input is invalid, or hide the label when input is valid.
Sample
https://minatonda.github.io/light-validate-angular-ui/
Install
$ npm install -save light-validate$ npm install -save light-validate-angular-ui$ npm install -save reflect-metadata
Development and Implementation - Configuring on Angular ...
Add the 'UiLightValidateModule' on imports array of your Component's Module.
Customize Label Messages
Development and Implementation - Create your LightRules ...
Create some LightRules...
;
Development and Implementation - Create your Mapping Class ...
Create your mapping class...
;;;;;;
Development and Implementation - Use on Component ...
Add your target mapping class to an component property
;
And call the directive on your template code
<!-- [UiLightValidate] attribute needs to bind the Mapping Class --><!-- UiLightProperty needs to receive the property name to be validated on directive --><!-- [UiLightTarget] attribute needs to bind target model to be validate on directive--> Name UserName Password ConfirmPassword <!-- If you registered the mapping class in the mappings parameter in the module's forRoot function, you can also use the name of mapping it as follows: UiLightValidate="UserLightMapping" !-->
Attributes
Attribute | Description | Type | Default |
---|---|---|---|
UiLightValidate | Directive selector, also receives the mapping class directly, or the name of the class if the mapping class is registered on forRoot 'mapping' option. | Object/string | undefined |
UiLightProperty | Receives the property key of the target to be validated. | string | undefined |
UiLightTarget | Receives the target to be validated. | Object | undefined |
ui-light-validate-on-blur | Enables validation on the blur event of the element. | boolean | true |
ui-light-validate-on-change | Enables validation on the change event of the element. | boolean | true |
ui-light-validate-on-keyup | Enables validation on the keyup event of the element. | boolean | true |
ui-light-validate-icon-enabled | Enables the validation icon. | boolean | false |
ui-light-validate-invalid-class | Receives the name of the class that will represent the invalid state of the element. | string | light-invalid |
ui-light-validate-valid-class | Receives the name of the class that will represent the valid state of the element. | string | light-valid |
ui-light-validate-message-class | Receives the name of the label class that will represent the state of the element. | string | light-message |