you should maybe store the original state in a temporary javascript variable ? and by the ng-click event to a JS method.
2015-03-11 15:08 GMT+01:00 KJ <[email protected]>: > Hi, > > I have a input field which gets data from the database and is inside div > together with edit button next to it. > <input type="text" ng-model="user.value" /> > > When the user clicks on the edit button I show save and cancel button. > Clicking save calls service and saves data. > Now what if user edits values in the box and then clicks cancel that > should reset the box back to orginal state. > > I tried to add ng-click = "user.value='';" > > But this clears even the value that I bind from the db. How can reset the > box to previous state. > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Emmanuel DEMEY Ingénieur Etude et Développement Worldline, an atos company +33 (0)6 47 47 42 02 [email protected] - fr.linkedin.com/in/emmanueldemey/ Twitter : @EmmanuelDemey -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
