Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankyso/ion-input-validator
Ionic Form Validator
https://github.com/frankyso/ion-input-validator
angular7 ionic ionic-apps ionic4 validation-library validator
Last synced: 3 days ago
JSON representation
Ionic Form Validator
- Host: GitHub
- URL: https://github.com/frankyso/ion-input-validator
- Owner: frankyso
- Created: 2019-08-03T02:36:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T07:06:23.000Z (over 5 years ago)
- Last Synced: 2024-11-11T18:47:08.268Z (2 months ago)
- Topics: angular7, ionic, ionic-apps, ionic4, validation-library, validator
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IONIC Form Validator
## Getting Started
clone this repo into your project and import ``IonFormValidatorModule`` into your page module
## Implementation
### HTML TemplateInclude your directive into the same tag with ``[FormGroup]``
```
```### On Ts File
```
public validator = this.formBuilder.group({
username: ['', [ValidationService.required]],
password: ['', [
ValidationService.required,
ValidationService.startsWith("08")
]]
});
```## Available Validation Method
### required
The field under validation must be present in the input data and not empty.### alpha
The field under validation must be entirely alphabetic characters.### alpha_num
The field under validation must be entirely alpha-numeric characters.### password
The field under validation must be 6 or more character and must include numeric character.### confirmed
The field under validation must have a matching field of ``foo_confirmation``. For example, if the field under validation is password, a matching ``password_confirmation`` field must be present in the input.
The field under validation must be formatted as an e-mail address.### unique
### numeric
The field under validation must be numeric.### phone
The field under validation must be formatted as an phone number.### min
The field under validation must have a minimum value. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.### max
The field under validation must be less than or equal to a maximum value. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.### minlength
The field under validation must be more than specified value### startsWith
The field under validation must start with one of the given values.## Upcoming Validation Rule Converted from Laravel
* alpha_dash
* array
* before:date
* before_or_equal:date
* between:min,max
* boolean
* date
* date_equals:date
* date_format:format
* different:field
* digits:value
* digits_between:min,max
* dimensions
* distinct
* ends_with:foo,bar,...
* filled
* gt:field
* gte:field
* in:foo,bar,...
* in_array:anotherfield.*
* integer
* ip
* ipv4
* ipv6
* json
* lt:field
* lte:field
* mimetypes:text/plain,...
* nullable
* present
* regex:pattern
* required_if:anotherfield,value,...
* required_unless:anotherfield,value,...
* required_with:foo,bar,...
* required_with_all:foo,bar,...
* required_without:foo,bar,...
* required_without_all:foo,bar,...
* same:field
* size:value
* string
* timezone
* url
* uuid## Authors
* **Franky So** - *Initial work*
See also the list of [contributors](https://github.com/frankyso/ion-input-validator/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* This validator inspired by Laravel Validator.
* Based On Angular Reactive Form Module
* etc