https://github.com/caferrari/md-form-validator
Simplify the usage of ngMessages with the angular material design
https://github.com/caferrari/md-form-validator
angular-material angularjs javascript
Last synced: about 1 year ago
JSON representation
Simplify the usage of ngMessages with the angular material design
- Host: GitHub
- URL: https://github.com/caferrari/md-form-validator
- Owner: caferrari
- Created: 2016-02-17T10:15:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T16:51:23.000Z (over 9 years ago)
- Last Synced: 2025-05-17T19:06:56.027Z (about 1 year ago)
- Topics: angular-material, angularjs, javascript
- Language: JavaScript
- Size: 34.2 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Angular Material Design Form Validator
======================================
A collection of directives that simplify the form validation with the Angular Material Design
[Demo](http://codepen.io/caferrari/pen/zrQBvY?editors=1010)
How to install
--------------
`bower install --save md-form-validator`
Config Default Messages
-----------------------
```javascript
angular.module("myApp").config(function(mdFormValidatorProvider) {
mdFormValidatorProvider.setMessage("required", "This field is required");
mdFormValidatorProvider.setMessage("maxlength", "Please enter no more than {maxlength} characters");
}]);
```
**With default messages you don´t need to add a md-message() for each validation:**
Before:
```html
Código
Required
```
After default messages:
```html
Código
```
To override the message:
```html
Código
This is my cool required message for this field
```