Not angular however looks like a simple JS code
On initial load, Store the existing input value in some local JS variable
and then on cancel reset the input value to the originalValue.

On Wed, Mar 11, 2015 at 10:08 AM, KJ <[email protected]
<javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:

> 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]
> <javascript:_e(%7B%7D,'cvml','angular%[email protected]');>.
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Rishi Tandon*
Pearson Learning Technology Group

Mobile: (310) 926-9032

Pearson
Always Learning
Learn more at www.pearson.com


-- 
*Rishi Tandon*
Pearson Learning Technology Group

Mobile: (310) 926-9032

Pearson
Always Learning
Learn more at www.pearson.com

-- 
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.

Reply via email to