Currently, I am going through an angular-meteor tutorial that can be found here
I seem to be facing some issues with my code. Here's what I have:
angular.module('socially').controller('PartyDetailsCtrl', function($scope, $stateParams, $meteor){
$scope.party = $meteor.object(Parties, $stateParams.partyId, false);
$scope.save = function() {
$scope.party.save().then(function(numberOfDocs){
console.log('save success doc affected ', numberOfDocs);
}, function(error){
console.log('save error', error);
});
};
$scope.reset = function() {
$scope.party.reset();
};
});
Below is the HTML code:
You will find party details displayed here:
<input type="text" ng-model="party.name">
<input type="text" ng-model="party.description">
<button ng-click="save()">Save</button>
<button ng-click="reset()">Reset form</button>
<button ui-sref="parties">Cancel</button>
The save button works fine and saves the object without any issues. However, when I try to reset the form using the reset button, it doesn't seem to do anything – no errors are shown either.