Prevent the domain input from accepting trailing dots

This commit is contained in:
Johannes Zellner
2017-02-10 11:18:44 +01:00
parent 62e59868b4
commit 8cc15726ec
+2 -1
View File
@@ -8,7 +8,8 @@ angular.module('ngTld', [])
function ngTld() {
var tldExists = function($path) {
return $path.$viewValue === tld.getDomain($path.$viewValue);
// https://github.com/oncletom/tld.js/issues/58
return ($path.$viewValue.slice(-1) !== '.') && $path.$viewValue === tld.getDomain($path.$viewValue);
}
return {