You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I have often come across use cases where I want to be able to reset a resource back to its pristine state as it came from the server or other data source, not just a form. Of course, a form would inherit it due to 2-way binding.
Thus, I can do:
// in data sourceuser={name:"John",age:35};// in angularUser.get('123',function(user){// user.name is now "John"user.name="Steve";// or perhaps it was set in a form, etc.// user.name is now "Steve"user.$reset();// user.name is now "John"});;
I simply created my own wrapper to it, and call my Resource which itself calls $resource, but is this of interest for a PR?
Of course, if this functionality already exists in ngResource and I missed it, happy to just use that. :-)