I just started working with Angular and encountered an issue while trying to implement a reload button. My webpage displays a table with data pulled from a Parse database. The table can be modified using various buttons, and after making changes, I want to reload the table to reflect the original database data and undo any alterations made. Any guidance on how to achieve this would be highly appreciated!
$scope.reset = function() {
$scope.compOrder = [];
$scope.foundIndex = -1;
$scope.selectedItem = {};
$scope.citySelect($scope.currentCity);
}
To provide more context, below is the code snippet containing additional information. Please note that the citySelect function retrieves data from Parse to populate the model.
var myApp = angular.module('CompetitionManager',[]);
myApp.controller('MainController', ['$scope', function($scope) {
// Controller logic here...
}]);