Skip to content

Commit 6cf318c

Browse files
committed
Fix ghiscoding#10 - Bug with latest angular translate version
- Updated to latest version of Angular Translate - new bug found with that latest translate version, displaying [object Object]... now fixed - Also added instant validate check on Select (dropdown)
1 parent f8583d0 commit 6cf318c

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

angular-validation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@
351351
return false;
352352
}
353353
});
354+
}else if(elmTagName === "SELECT") {
355+
// select(options) will be validated on the spot
356+
typingLimit = 0;
354357
}
355358
}
356359

@@ -448,7 +451,7 @@
448451
}
449452
if(!isValid) {
450453
isFieldValid = false;
451-
message += $translate(validators[j].message);
454+
message += $translate.instant(validators[j].message);
452455

453456
// replace any error message params that were passed
454457
if(typeof validators[j].params !== "undefined") {

example-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ myApp.controller('Ctrl', ['$scope', '$translate', function ($scope, $translate)
2525
$scope.form1 = {};
2626

2727
$scope.switchLanguage = function (key) {
28-
$translate.uses(key);
28+
$translate.use(key);
2929
};
3030
}]);
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",["$q","$http",function(a,b){return function(c){if(!c||!c.prefix||!c.suffix)throw new Error("Couldn't load static files, no prefix or suffix specified!");var d=a.defer();return b({url:[c.prefix,c.key,c.suffix].join(""),method:"GET",params:""}).success(function(a){d.resolve(a)}).error(function(){d.reject(c.key)}),d.promise}}]);
1+
/*!
2+
* angular-translate - v2.2.0 - 2014-06-03
3+
* http://github.com/PascalPrecht/angular-translate
4+
* Copyright (c) 2014 ; Licensed MIT
5+
*/
6+
angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",["$q","$http",function(a,b){return function(c){if(!c||!angular.isString(c.prefix)||!angular.isString(c.suffix))throw new Error("Couldn't load static files, no prefix or suffix specified!");var d=a.defer();return b({url:[c.prefix,c.key,c.suffix].join(""),method:"GET",params:""}).success(function(a){d.resolve(a)}).error(function(){d.reject(c.key)}),d.promise}}]);

0 commit comments

Comments
 (0)