我在我的UI中使用Bootstrap框架和angularJS,我对这项技术很陌生。我面临的问题是
<div class="pull-right">
<button type="button" class="btn btn-info glyphicon glyphicon-plus" data-toggle="modal" data-target="#myModal">Add</button>{{Employee.name}}
<div class="modal fade" id="myModal" role="dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">{{Employee.name}}
<div class="modal-dialog" role="document">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form>
<p>
<input type="text" class="form-control" name="uri" ng-model="uri">
</p>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-sm col-lg-2 col-md-offset-7 pull-centre glyphicon glyphicon-remove" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
基类中{{employee.name}}的值与模态
中的值不同注意:在上面的代码中我使用ng-repeat所以在每次迭代之后,employee.name的值会发生变化。更改出现在基类中,但在模态类值中,更改值始终不变(仅显示第一个员工的姓名)