1

I have the following template:

<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>

The following line not work: {"ng-model", "dailyInformation.OverTimeFormatted"}

and dailyInformation.OverTimeFormatted doesn't update if I change textbox value !

Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232

1 Answers1

1

ng-model is not supposed to work within ng-if

Usually you can avoid that with ng-model="$parent.dailyInformation.OverTimeFormatted"