1
我有以下模板:ng-if在ng-if和ng-repeat中不起作用,AngularJs?
<tr ng-repeat="dailyInformation in TradodModel.Model.EmployeeDayRelatedData.DailyInformation track by $index" ng-click="DailyInformationRowOnClick(dailyInformation, $event)" data-selected="{{dailyInformation.IsSelected}}" data-rowindex="{{dailyInformation.RowIndex}}">
<td ng-if="!IsHourlyContract() && DailyOverShowType() != @((short) DailyOverShowTypeEnumeration.NotShow) && !DailyOverType()" data-changed="{{dailyInformation.HasOverTimeChange()}}" title="{{dailyInformation.OverTimeTitle()}}" class="{{BgCssClass()}}">
@if (ViewBag.HasWritePermission)
{
@Html.BootstrapTimeTextBox("OverTimeTextBox", "", false, false, 2, false,
new Dictionary<string, object>
{
{"data-disableindexing", "true"},
{"ng-if", "DailyOverShowType() == " + (short)DailyOverShowTypeEnumeration.Editable},
{"ng-model", "dailyInformation.OverTimeFormatted"},
{"ng-disabled", "ViewOnlyMode()"},
{"ng-keydown", "TradodOverTimeOnKeyDown(dailyInformation, $event)"},
{"ng-keyup", "TradodOverTimeOnKeyUp($event)"},
{"ng-focus", "TradodOverTimeOnFocus($event)"},
{"ng-blur", "TradodOverTimeOnBlur()"},
{"data-overtime-index", "{{dailyInformation.RowIndex}}"}
})
}
else
{
<div style="width: 50px;" ng-if="DailyOverShowType() == @((short)DailyOverShowTypeEnumeration.JustShow)">{{dailyInformation.OverTimeFormatted1()}}</div>
}
</td>
</tr>
以下行不行: { 「NG-模式」, 「dailyInformation.OverTimeFormatted」}
和dailyInformation.OverTimeFormatted
如果我改變文本框的值不更新!
'NG-模型= 「$ parent.dailyInformation.OverTimeFormatted」'不行 –