我正在将angularJS与rzSlider一起使用,以允许用户手动输入数字值或使用滑块,该滑块随后将填充输入。问题是当他们拖动滑块,然后从输入字段删除整个输入时,rzslider底限变为未定义或NaN。我正在使用指令绘制HTML。
HTML:
'<div class="form-group position-relative mb-5">' +
'<label class="mb-3 calculatorLabel">How much are you looking to borrow? <a tabindex="0" data-toggle="popover" data-trigger="focus" title="How Much Can you Borrow" data-content="And here\'s some amazing content. It\'s very engaging. Right?"><i class="far fa-question-circle"></i></a></label>' +
'<input class="form-control form-control-lg text-transform-none" type="number" min="0" ng-required="true" title="Please Enter loan amount" maxlength="7" ng-model="model.autoLoan.borrowAmount">' +
'<rzslider rz-slider-model="model.autoLoan.borrowAmount" rz-slider-options="model.autoLoan.slider.borrowAmount.options"></rzslider>' +
'</div>' +
答案 0 :(得分:0)
添加ng-model="model.autoLoan.borrowAmount || 0"
纠正了此问题,谢谢@holydragon