I have looked at various form reset examples for AngularJS, and they all more or less end up at the same thing -- do an angular.copy from the original data.
However...
When I do an angular.copy, it's almost as if it's replacing my form with [] instead of the expected original data.
Portion of the controller:
//get my data
$scope.phones = api.phones.query();
//"save" the original state
$scope.original = $scope.phones
console.log($scope.personalphones); //result: [$promise: Object, $resolved: false]
$scope.reset() = function() {
angular.copy($scope.original, $scope.phones);
$scope.phones.form.$setPristine();
}
Any help or ideas why this might be happening would be greatly appreciated.
$resourcewhen you doapi.phones.query()?