0
<td rowspan="5" colspan="2">
<div id="style-2" class="scrollit">
<table class="table-borderless table-condensed" style="height:100px; width:100%; overflow-y:scroll">
<tr>
<td colspan="2" class="verticleAlignMidle">
<h6><b>{{ctrl.commentsBox.length}} Comments:</b></h6>
</td>
</tr>
<tr ng-repeat="item in ctrl.commentsBox">
<td class="width8">
<div class="commentCol divStyle">{{item.name}}</div>
</td>
<td class="width11">
<span><b>{{item.FullName}}</b> {{item.date}}</span>
<br /> <span>{{item.comment}}</span>
</td>
</tr>
</table>
</div>
</td>
這是我的列表。需要在添加註釋,然後按更新輸入:更新js文件中的列表後,我的UI沒有更新
<td class="width33 verticleAlignMidle" colspan="2">
<textarea cols="80" rows="5" ng-keyup="$event.keyCode == 13 ? ctrl.saveAdGroup() : null"
ng-model="ctrl.textComment" ng-view="ctrl.textComment" placeholder="Write a comment"></textarea>
</td>
而且功能:
ctrl.saveAdGroup = function() {
var ctrl = this;
var c = ctrl.textComment;
ctrl.textComment = "";
var n = "DN";
var fullName = "Dummy Name";
var formatDate = ctrl.dates();
var objComment = { name: n, date: formatDate, comment: c, FullName: fullName };
ctrl.commentsBox.push(objComment);
alert(ctrl.commentsBox.length);
};
我m如果在警告增加了長度,但是在UI沒有反映。
可以添加小提琴/ plunkr ...? – Aks1357