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

Commit 046ffe0

Browse files
committed
Merge pull request #3 from ghiscoding/master
merge from master
2 parents 1013721 + 745dc24 commit 046ffe0

File tree

16 files changed

+158
-38
lines changed

16 files changed

+158
-38
lines changed

app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ myApp.config(['$compileProvider', '$locationProvider', '$routeProvider', functio
99
templateUrl: 'templates/testingFormDirective.html',
1010
controller: 'CtrlValidationDirective'
1111
})
12+
.when('/validate-2forms', {
13+
templateUrl: 'templates/testing2Forms.html',
14+
controller: 'Ctrl2forms'
15+
})
1216
.when('/validate-service', {
1317
templateUrl: 'templates/testingFormService.html',
1418
controller: 'CtrlValidationService'
@@ -54,6 +58,17 @@ myApp.controller('CtrlValidationDirective', ['$scope', 'validationService', func
5458
}
5559
}]);
5660

61+
myApp.controller('Ctrl2forms', ['$scope', 'validationService', function ($scope, validationService) {
62+
$scope.submitForm = function() {
63+
if(new validationService().checkFormValidity($scope.form01)) {
64+
alert('All good, proceed with submit...');
65+
}
66+
}
67+
$scope.showValidationSummary = function () {
68+
$scope.displayValidationSummary = true;
69+
}
70+
}]);
71+
5772
// -- Controller to use Angular-Validation Service
5873
// -----------------------------------------------
5974

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ghiscoding.angular-validation",
3-
"version": "1.3.14",
3+
"version": "1.3.15",
44
"authors": [
55
"Ghislain B."
66
],

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Angular-Validation change logs
1515
1.3.11 (2015-03-30): Accepted pull request #15 to fix form without name attribute. Also accepted pull request #18 to add Spanish locales.
1616
1.3.12 (2015-04-04): Fix issue #16 and added Validators Alternate Text option on all type of validators. Also fixed removeValidator and clean a lot of code.
1717
1.3.13 (2015-04-06) Fixed $translate delay issue when using external JSON files
18-
1.3.14 (2015-04-07) Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators.
18+
1.3.14 (2015-04-07) Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators.
19+
1.3.15 (2015-04-08) Fixed #23 If multiple forms exist in the app the errors in 1 form affect validation in the other

dist/angular-validation.min.js

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

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ <h1>Angular-Validation Directive|Service (ghiscoding)</h1>
2727
<div class="btn-group btn-group-sm">
2828
<button type="button" class="btn btn-default" ng-click="goto('/validate-directive')">Directive</button>
2929
<button type="button" class="btn btn-default" ng-click="goto('/validate-service')">Service</button>
30+
<button type="button" class="btn btn-default" ng-click="goto('/validate-2forms')">2 Forms</button>
3031
</div>
3132

3233
<br/><hr/>

locales/validation/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "Field is required. ",
5252
"INVALID_URL": "Must be a valid URL. ",
5353
"INVALID_TIME": "Must be a valid time format (hh:mm) OR (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected. ",
5555

5656
"AREA1": "TextArea: Alphanumeric + Minimum(15) + Required",
5757
"ERRORS": "Errors",

locales/validation/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "El campo es requerido. ",
5252
"INVALID_URL": "Debe contener una dirección URL valida. ",
5353
"INVALID_TIME": "Debe contener un formato de tiempo valido (hh:mm) ó (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "Casilla de verificación debe ser seleccionado. ",
5555

5656
"AREA1": "Area de texto: Alfanúmerica + Minimo(15) + Requerido",
5757
"ERRORS": "Errores",

locales/validation/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "Le champ est requis. ",
5252
"INVALID_URL": "Doit être un URL valide. ",
5353
"INVALID_TIME": "Doit être un format de date valide (hh:mm) OU (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "La case à cocher doit être sélectionnée. ",
5555

5656
"AREA1": "TextArea: Alphanumérique + Minimum(15) + Required",
5757
"ERRORS": "Erreurs",

more-examples/dynamic-app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $
1616
prefix: '../locales/validation/',
1717
suffix: '.json'
1818
});
19-
19+
2020
// load English ('en') table on startup
2121
$translateProvider.preferredLanguage('en');
2222
}])
2323
.controller('CtrlDynamic', ['$scope', '$translate', function ($scope, $translate) {
2424
$scope.form1 = {};
25-
25+
2626
$scope.switchLanguage = function (key) {
2727
$translate.use(key);
2828
};
@@ -48,7 +48,7 @@ myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $
4848
modal: '=',
4949
validate:'='
5050
},
51-
replace: true,
51+
replace: true,
5252
template: '<input type="text" class="form-control" ng-model="modal" validation="{{validate}}" />',
5353
link: function (scope, element, attrs) {}
5454
}

more-examples/dynamicForm.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<form novalidate name="formAdd" method="POST">
2-
<fieldset>
3-
<div class="form-group" ng-repeat="k in data">
2+
<fieldset>
3+
<div class="form-group" ng-repeat="k in data">
44
<label for="k.name">{{k.name}}</label>
55
<dyninp modal="k.title" name="{{k.name}}" validate="k.validate"></dyninp>
6-
<span ng-class="validation-{{k.name}} validation text-danger"></span>
76
</div>
87
</fieldset>
98

109
<div class="form-actions">
1110
<!-- ng-disabled="formAdd.$invalid" -->
1211
<button type="submit" name="save_btn" class="btn btn-primary" ng-disabled="formAdd.$invalid" ng-click="">{{ 'SAVE' | translate }}</button>
13-
</div>
12+
</div>
1413
</form>

0 commit comments

Comments
 (0)