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

Commit 931d3b0

Browse files
committed
Added Validation Summary and Minified scripts
- Added validation summary through 2 new and equivalent properties `$scope.$validationSummary` and `$scope.formName.$validationSummary`. - Added `bower` and `gulp` support, the Gulp script gives minified files.
1 parent 186872b commit 931d3b0

19 files changed

+335
-99
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ $RECYCLE.BIN/
192192
# Packages
193193
*.egg
194194
*.egg-info
195-
dist/
196195
build/
197196
eggs/
198197
parts/

app.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@ myApp.config(['$compileProvider', '$locationProvider', '$routeProvider', functio
2929

3030
// -- Main Controller for Angular-Validation Directive
3131
// ---------------------------------------------------
32-
myApp.controller('Ctrl', ['$location', '$scope', '$translate', function ($location, $scope, $translate) {
32+
myApp.controller('Ctrl', ['$location', '$route', '$scope', '$timeout', '$translate', function ($location, $route, $scope, $timeout, $translate) {
3333
$scope.switchLanguage = function (key) {
34+
// change the translation language & reload the page for a better handling of the validation translation
35+
// the timeout+reload ensures validation translations had time to re-render
3436
$translate.use(key);
37+
$timeout(function() {
38+
$route.reload();
39+
}, 50);
40+
3541
};
3642
$scope.goto = function ( path ) {
3743
$location.path( path );
3844
};
45+
$scope.showValidationSummary = function () {
46+
$scope.displayValidationSummary = true;
47+
}
3948
}]);
4049

4150

@@ -86,5 +95,7 @@ myApp.controller('CtrlValidationService', ['$scope', '$translate', 'validationSe
8695
$scope.removeInputValidator = function ( elmName ) {
8796
// remove a single element (string) OR you can also remove multiple elements through an array type .removeValidator(['input2','input3'])
8897
myValidation.removeValidator(elmName);
98+
99+
$scope.enableRemoveInputValidatorButton = false;
89100
};
90101
}]);

bower.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
22
"name": "ghiscoding.angular-validation",
3-
"version": "1.3.8",
3+
"version": "1.3.9",
44
"authors": [
55
"Ghislain B."
66
],
77
"description": "AngularJS Form Validation (Directive / Service)",
88
"main": [
99
"locales/validation/en.js",
1010
"locales/validation/fr.js",
11+
"dist/angular-validation-allin1.min.js",
12+
"dist/validation-common.min.js",
13+
"dist/validation-directive.min.js",
14+
"dist/validation-rules.min.js",
15+
"dist/validation-service.min.js",
1116
"src/validation-common.js",
1217
"src/validation-directive.js",
1318
"src/validation-rules.js",
@@ -23,19 +28,20 @@
2328
"bower_components",
2429
"test",
2530
"tests",
26-
"more-examples",
31+
"more-examples",
2732
"templates",
28-
"vendors"
33+
"vendors",
34+
"README.md"
2935
],
3036
"homepage": "http://github.com/ghiscoding/angular-validation",
3137
"repository": {
3238
"type": "git",
3339
"url": "git://github.com/ghiscoding/angular-validation"
3440
},
3541
"dependencies": {
36-
"angular": ">= 1.2.0",
42+
"angular": ">= 1.2.0",
3743
"angular-route": ">= 1.2.0",
3844
"angular-translate": ">= 2.4.2",
3945
"angular-translate-loader-static-files": ">= 2.4.2"
4046
}
41-
}
47+
}

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ Angular-Validation change logs
99
1.3.5 (2015-01-26): Throw an error message when user did not provide a name="" property inside the element to validate.
1010
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.
1111
1.3.7 (2015-03-08): Complete rewrite (but same functionality) so that I could add an Angular-Validation Service which is similar implementation as the Directive. Also added `debounce` attribute which is an alias to `typingLimit`, validation rules are now defined as an external service for better maintainability and also created a common file for shared functions by both Validation Directive and Service.
12-
1.3.8 (2015-03-15): Added between/min/max conditional validators on all Date types (ISO, EURO_LONG, EURO_SHORT, US_LONG, US_SHORT)
12+
1.3.8 (2015-03-15): Added between/min/max conditional validators on all Date types (ISO, EURO_LONG, EURO_SHORT, US_LONG, US_SHORT)
13+
1.3.9 (2015-03-21): Added validation summary through 2 new and equivalent properties `$scope.$validationSummary` and `$scope.formName.$validationSummary`. Also added `bower` and `gulp` support, the Gulp script gives minified files.

dist/angular-validation-allin1.min.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/validation-common.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/validation-directive.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)