There seems to be a problem with the reset button functionality on my webpage. Although it initially works, it only works once and then requires a reload of the page to function again.
Here is the JS code:
var ctrl = this;
var original_device = angular.copy(device.data);
ctrl.device = device.data;
ctrl.reset = function () {
ctrl.device = original_device;
};
And here is the snippet from the HTML file:
<button ng-click="ctrl.reset()">Reset</button>