1

I have this 2 variables:

scopeReceiving.selectedBillet.Fee = rowData.Fee;
scopeReceiving.selectedBillet.Interest = rowData.Interest;

These are their view:

<input id="exemptFee" class="form-control" onchange="calculateExampt()" type="text" min="0" ng_model="selectedBillet.Fee" format="currency" number-input />
<input id="exemptInterest" class="form-control" onchange="calculateExampt()" type="number" min="0" ng_model="selectedBillet.Interest" format="currency" number-input />

the Fee is aways showing the number 5 instead of the passed value and Interest is displaying correctly:

enter image description here

I searched the code and in no place I'm setting this number 5 value. If the code hits a breakpoint it shows correctly. Other way to show is to put a 500ms delay on the variable, but it's an ungly solution and it works only once:

enter image description here

I have no idead of why this is happening.

I already searched for the id of the form and scopevalues nothing is being set on the whole code, I tried everything, $apply(), $digest(), changing coding order, etc.., nothing works.

Does anyone know what could be happening?

MvD
  • 37
  • 11
  • 1
    `onchange` is native property, try to use `ng-change` instead – Drag13 Jan 08 '21 at 14:25
  • Thanks, but the function is not the problem, but I tried anyway and id didn't work. The variable scopeReceiving.selectedBillet.Fee is receiving the 5300 value, but its showing as 5 on the view unless I put a timer on it or it hits a breaking point before executing – MvD Jan 08 '21 at 14:35
  • Ok, could you please share how do you apply this changes? `scopeReceiving.selectedBillet.Interest = rowData.Interest` – Drag13 Jan 08 '21 at 14:42
  • I'm not doing anything different from on another. ... function examptFeesAndInterest(row) { var rowData = $('#grid-billets').jqxGrid('getrowdata', row); scopeReceiving.selectedBillet.originalBillet.Fee = rowData.Fee; scopeReceiving.selectedBillet.originalBillet.Interest = rowData.Interest; scopeReceiving.selectedBillet.Fee = rowData.Fee; scopeReceiving.selectedBillet.Interest = rowData.Interest; $.popup({ //...opening pop-up }); }); } – MvD Jan 08 '21 at 14:46
  • Mixing jQuery and Angular... well that's the problem. Solution : remove jQuery. Or Angular. See my answer [here](https://stackoverflow.com/questions/51304288/what-is-the-right-way-to-use-jquery-in-react/51304632) – Jeremy Thille Jan 08 '21 at 15:26
  • Yes, don't use jquery or any lib that manipulates the DOM. Do that in angular. – Celsiuss Jan 08 '21 at 23:23

0 Answers0