简体   繁体   English

无法使用angular.js绑定输入字段内的数据

[英]Can not bind data inside input field using angular.js

I have two input filed and those are given below. 我有两个输入文件,下面给出了这些输入。

<input type="text" name="itemname" id="contactno" class="form-control" placeholder="short name" ng-model="dept_short_name" >
<input type="text" name="itemname" id="contactno" class="form-control" ng-model="loginname" readonly="readonly" value="{{dept_short_name}}" >

I need when user will type any text in first input field the second input field will update with same data simultaneously.Please help me. 我需要当用户在第一个输入字段中键入任何文本时,第二个输入字段将同时更新相同的数据。请帮助我。

<input type="text" ng-model="dept_short_name" />
<input type="text" readonly="readonly" ng-model="dept_short_name"></input>

It is simplest one task using angularjs. 使用angularjs是最简单的任务。 Check the fiddle link. 检查小提琴链接。

LINK:

FIDDLE 小提琴

在控制器手表dept_short_name和更改loginname ,只要你想里面的手表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM