javascript - 如何使用 AngularJS 获取 HTML-INPUT-EMAIL?

标签 javascript html angularjs

我有输入:

<input ng-model="email" type="email" id="form-email" name="email" placeholder="Inter email" maxlength="250">

当我进入这么长的托管时:

fax@test.cooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom

我有:

$scope.email // undefined
document.getElementById("form-email").value //fax@test.cooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom

但是当我进入

fax@testooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh.com

我有

$scope.email // fax@testooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh.com

如何解决这个问题?

最佳答案

这没有问题,第一封电子邮件无效,第二封电子邮件有效,这就是它被接受的原因。

Each domain name consists of two parts.

Top Level Domain - A top-level domain (TLD) is the part of the domain name located to the right of the dot. The most common top-level domains are .COM, .NET, and .ORG. Some other popular top-level domains are .BIZ, .INFO, .NAME and .IN etc.

Second Level Domain - . The second-level domain name is the part of the domain name located to the left of the dot. Steps-to-make-your-own-website is the second-level domain name and represents the organization or entity behind the internet. Second Level Domain name must be registered with an Internet Corporation for Assigned Names and Numbers (ICANN)-accredited registrar.

为什么第一封电子邮件无效?

  • 因为它不包含有效的顶级域。

以下是互联网顶级域的列表: https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

为什么第二封电子邮件有效?

  • 因为它包含有效的顶级域和二级域。

关于javascript - 如何使用 AngularJS 获取 HTML-INPUT-EMAIL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28826804/

相关文章:

javascript - 如何在 extjs 中获取枚举名称?

javascript - 如何创建像nexus5网站那样的页面滚动按钮

javascript - jQuery格式化负数

javascript - 添加动态内容后,从 div 中删除占位符图像

javascript - Angular 中的全局变量

javascript - 如何获取jquery数组中各个元素的属性

html - CSS 媒体查询层次结构 - 为什么 "Smaller"媒体查询不在浏览器/检查器中呈现?

javascript - 如何检查一个变量是否大于多个其他变量?

javascript - 使用 Angular ui路由器的多步表单

javascript - AngularJS 动态表单与 ng-repeat