我定义了AngularJS日期格式。
如果有日期,这可以正常工作。但是,如果日期为NULL,则会出现以下屏幕,并试图找出如何简单地用空格替换日期格式。
cODE bELOW:
CS档案:
namespace WarrantyUI.Models
{
public class CheckDepositViewModel
{
public string FunctionName { get; set; }
public bool readOnlyCheckDepositHeaderId { get; set; }
public bool readOnlyTotalAmount { get; set; }
public bool readOnlyJVNumber { get; set; }
public bool readOnlyCheckDepositSlipNumber { get; set; }
public bool readOnlyTransactionNumber { get; set; }
public bool readOnlyDateSubmittedToGL { get; set; }
public bool readOnlyDatePostedToGL { get; set; }
public bool readOnlyDateSubmittedToBank { get; set; }
public bool readOnlyCountryCode { get; set; }
public bool readOnlyClaimStatusDescription { get; set; }
public bool showCheckHeaderSearch { get; set; }
public bool newCheckDeposit { get; set; }
public bool ViewOnly { get; set; }
public bool NewCheckDeposit { get; set; }
}
}
CSHTML文件
<div class="form-group">
<div class="col-sm-4">
<label class="control-label align-left">DateSubmitted To GL:</label>
</div>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="gridCtrl.row.entity.DateSubmittedToGL" ng-readonly="'@Model.readOnlyDateSubmittedToGL'" />
</div>
</div>
答案 0 :(得分:0)
我会做{{DateToBeshownScopeVariable || “}}}如果范围变量为空
,这将用”“替换字段