【发布时间】:2017-10-10 06:38:32
【问题描述】:
我有下面的方框来填写信息:
我有下面的代码来创建上面的盒子:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<!-- server Location Field -->
<div class="form-group" style="width: 80%; margin-left:10%;" >
<span style="position: relative;color:red; left: -10px"><font>*</font> </span>
<input maxlength="20" type="text" class="form-control filled" ng-model="ctrl.form1.serverLocation" placeholder="serverLocation" name="serverLocation" ng-required="ctrl.form1.date=='Enable'"></input>
<span ng-show="f2.serverLocation.$dirty && f2.serverLocation.$error.required" style="color: red"> server Location is required</span>
</div>
我正在尝试创建一个按钮,单击该按钮从 .text 文件中获取要在框中填充的值。例如,对于上面的框,要从文本文件中选择的值是“server_location” .文本文件包含许多字段,例如:
image_location=pqc_11
db_location=xyz_2233
server_location=abc-1122
请帮助了解如何通过单击按钮来填充框。我正在使用 Angular JS 来创建填充框。提前致谢。
【问题讨论】:
-
以Check this link的形式从文件中读取数据并简单地绑定到box
标签: javascript html angularjs angular-ui-bootstrap