Angularjs - 之后,我输入一个值A< intput>与NG-模型中的值更改为未定义场 [英] Angularjs - after I enter a value into a <intput> field with ng-model the value changes to undefined

查看:205
本文介绍了Angularjs - 之后,我输入一个值A< intput>与NG-模型中的值更改为未定义场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的表格,接受输入。出于某种原因,当我改变的值范围变量的变化来定义。

I have a simple form that accepts an input. For some reason when I change the value the scope variable changes to undefined.

<body ng-controller="myctrler">
<input ng-model="t.unsubscribeEmail" type="email" class="textboxfields" placeholder="Enter email address">
</body>

在控制器:

$scope.k=
{
    unsubscribeEmail : "not"
};

在我输入任何内容到输入框的值是不。当我在输入类型的东西值的变化来定义。

The value before I enter anything into the inputbox is "not". As soon as I type something in the input the value changes to undefined.

我是什么失踪?

推荐答案

更改输入类型的文字或写电子邮件的Valide

Change your input type text or write valide email

<input ng-model="t.unsubscribeEmail" type="text" class="textboxfields" placeholder="Enter email address">

或写电子邮件的Valide

or write valide email in

<input ng-model="t.unsubscribeEmail" type="email" class="textboxfields" placeholder="Enter email address">

这篇关于Angularjs - 之后,我输入一个值A&LT; intput&GT;与NG-模型中的值更改为未定义场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆