Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit a06a2e8

Browse files
committed
typo
1 parent e47e91f commit a06a2e8

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

readme.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
### Form validation after user inactivity (customizable timeout)
33
`Version: 1.3.4`
44

5-
Angular Validation made easy! Angular Validation is an angular directive with locales (languages) with a simple approach of defining your validation="" directly within your element to validate (input, textarea, etc) and...that's it!!! The directive will take care of the rest!
5+
Angular Validation made easy! Angular Validation is an angular directive with locales (languages) with a simple approach of defining your `validation=""` directly within your element to validate (input, textarea, etc) and...that's it!!! The directive will take care of the rest!
66

77
The base concept is not new, it comes from the easy form input validation approach of Laravel Framework as well as PHP Gump Validation. They both are built in PHP and use a very simple approach, so why not use the same concept over Angular as well? Well now it is available and with some extras.
88

9-
For a smoother user experience, I also added validation on inactivity (timer). So validation will not bother the user while he is still typing...though as soon as user makes a pause for a certain amount of time, then validation comes in play. This feature is only while typing, if user is focusing out of the input (onBlur) it will validate instantly.
9+
For a smoother user experience, I also added validation on inactivity (timer). So validation will not bother the user while he is still typing... but as soon as the user makes a pause for a certain amount of time, then validation comes into play. This feature is only while typing, if user is focusing out of the input (onBlur) it will validate instantly.
1010

1111
Now also supporting AngularJS 1.3.x
12-
*current code should work with 1.2.x just the same*
12+
*current code should work with 1.2.x just the same but is no more verified*
1313

1414
## Live Demo
1515
[Plunker](http://plnkr.co/jADq7H)
@@ -18,7 +18,7 @@ Now also supporting AngularJS 1.3.x
1818
## Requirements
1919
Angular-Validation requires the element that will use validation to have a `name=""` attribute, so that it can use this name to associate a `<span>` for error displaying. For example: `<input name="input1" ng-model="input1" validation="validator1" />`.
2020

21-
*The necessity of `name=""` attribute is new since version 1.3.4+, prior to this change we were asking the user to create his own `<span>` for error displaying. To make it more clear, the `<span>` is now optional, but the `name=""` attribute becomes mandatory and will throw an error if omitted*
21+
*The necessity of `name=""` attribute is new since version 1.3.4+, prior to this change we were asking the user to create his own `<span>` for error displaying. For a better understanding, the `<span>` is now optional, but the `name=""` attribute becomes mandatory and will throw an error if omitted*
2222

2323

2424
## Some Working Examples
@@ -131,18 +131,6 @@ Step #1-4 are for explanation only, at the end we show the full regex (make sure
131131
Final code (no spaces): `regex:YYWW:=^(0[9]|1[0-9]|2[0-9]|3[0-9])(5[0-2]|[0-4][0-9])$:regex`
132132

133133

134-
Validation Event (default: keyup)
135-
--------------------
136-
We could also specify whichever validation event we want to trigger the validation (keyup, blur, etc...).
137-
138-
Features:
139-
140-
1. All possible events of the element are accepted `keyup`, `blur`, etc...
141-
142-
2. Event could be written with/without the `on` as prefix. `onblur` is equivalent to `blur`.
143-
144-
3. Default event `keyup` can be changed in the directive itself via constant `DEFAULT_EVENT`
145-
146134
Locales (languages)
147135
--------------------
148136
Locales are simply sets of language defined in external JSON files, we can easily add any new language as extra files without affecting the behaviour of the angular directive. You could even change displayed language on the fly, well of course the error message will be reflected only after field value is re-evaluated. You of course have to include the `angular-translate` library and configure it, see section [Include it in your Project](#project)
@@ -154,7 +142,7 @@ Note: To be fully localized, I should add the country code at the end of my JSON
154142
var key = 'fr';
155143

156144
$scope.switchLanguage = function (key) {
157-
$translate.uses(key);
145+
$translate.use(key);
158146
};
159147
```
160148

@@ -208,7 +196,7 @@ Include it in your app project:
208196
--------------------
209197
```javascript
210198
// include it your app module ( we need both Translate & Validation)
211-
var myApp = angular.module('myApp', ['ngRoute', 'pascalprecht.translate', 'ghiscoding.validation']);
199+
var myApp = angular.module('myApp', ['ngRoute', 'ghiscoding.validation', 'pascalprecht.translate']);
212200

213201
// include validation languages
214202
// if you want full localization add it in the suffix
@@ -228,7 +216,7 @@ Dependencies:
228216
------------------
229217

230218
1. Angular-Translate (https://github.com/PascalPrecht/angular-translate)
231-
2. Bootstrap 3.x *optional* (http://getbootstrap.com/)
219+
2. Bootstrap 3.x *is optional* (http://getbootstrap.com/)
232220
3. AngularJS 1.2.x / 1.3.x (https://angularjs.org/)
233221

234222
License
@@ -248,4 +236,4 @@ License
248236
* [1.3.3](https://github.com/ghiscoding/angular-validation/commit/7b3043a97006a3d7043b198f89c91f8b6c49476e) `2015-01-04` Added changelog & updated Bootstrap(3.3.1), AngularJS(1.3.7) to latest versions
249237
* [1.3.4](https://github.com/ghiscoding/angular-validation/commit/ba30d55ddb8bca44a8032fc8253356450bd4e1d4) `2015-01-06` Removed the necessity of creating a `<span>` for displaying the error message, the directive now handles it by itself.
250238
* [1.3.5](https://github.com/ghiscoding/angular-validation/commit/679b24ca4daee8419731c45d1d65d63cb5ca74a5) `2015-01-26` Throw an error message when user did not provide a `name=""` property inside the element to validate.
251-
* [1.3.6]() `2015-02-09` Added `ng-strict-di` for minification, renamed some files and folder lib to `/vendors`, moved directive into new `/src` folder for better separation.
239+
* [1.3.6](https://github.com/ghiscoding/angular-validation/commit/e47e91f45f93a3f191ab6849d06163563674e9e2) `2015-02-09` Added `ng-strict-di` for minification, renamed some files and folder lib to `/vendors`, moved directive into new `/src` folder for better separation.

0 commit comments

Comments
 (0)