用AngularJS实现对表格的增删改查(仅限前端),具体代码:
<Meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<Meta http-equiv="description" content="this is my page">
<Meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.11.1.js">
<script type="text/javascript" src="js/bootstrap.js">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js">
搜索:
<div class="modal" id="modal-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">
<span class="glyphicon glyphicon-remove"></span>
</button>
<h3 class="modal-title"><a href="https://www.jb51.cc/tag/tianjia/" target="_blank" class="keywords">添加</a>信息</h3>
</div>
<div class="modal-body">
<div>姓名:</div>
<input ng-model="newName" type="text">
<div>年龄:</div>
<input ng-model="newAge" type="text">
<div>城市:</div>
<input ng-model="newCity" type="text">
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal"><a href="https://www.jb51.cc/tag/guanbi/" target="_blank" class="keywords">关闭</a></button>
<button class="btn btn-success" ng-click="save()">保存</button>
</div>
</div>
</div>
<div class="modal" id="modal-2">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">
<span class="glyphicon glyphicon-remove"></span>
</button>
<h3 class="modal-title"><a href="https://www.jb51.cc/tag/xiugai/" target="_blank" class="keywords">修改</a>信息</h3>
</div>
<div class="modal-body">
<div>姓名:</div>
<input ng-model="prod.name" value="{{prod.name}}" type="text">
<div>年龄:</div>
<input ng-model="prod.age" value="{{prod.age}}" type="text">
<div>城市:</div>
<input ng-model="prod.city" value="{{prod.city}}" type="text">
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal"><a href="https://www.jb51.cc/tag/guanbi/" target="_blank" class="keywords">关闭</a></button>
<button class="btn btn-success" ng-click="ensure()">确定</button>
</div>
</div>
</div>