$setpristine() Method In Angular 1.2.1 Doesn't Appear To Work As Intended December 12, 2023 Post a Comment I have am trying to reset a textbox using the $setPristine function in AngularJS, however it doesn't seem to result in the desired behavior. My form looks like this: Solution 1: $setPristine does not clear values from the controls in the form:From the docs:Sets the form to its pristine state.This method can be called to remove the 'ng-dirty' class and set the form to its pristine state (ng-pristine class). This method will also propagate to all the controls contained in this form.Setting a form back to a pristine state is often useful when we want to 'reuse' a form after saving or resetting it.As you can see from the above description, $setPristine only changes the state of the form (and thereby resets the css applied to each control in the form). If you want to clear the values of each control, then you need to do for each in code.Baca JugaGet Vimeo Thumbnail For Video Using JquerySet Filelist Of Fileinput In FirefoxJs Security Issue With Opera 11.01, After Moving From Server A To BThis plunker shows $setPristine in action. Share You may like these postsFirebase Onauthstatechanged() Triggering Before Retrieving Name From Signup Form?How To Create A Line To Show Threshold In Bar GraphHow To Overwrite Anchor Element's Href Target And Remove Other Bugs In My Click-to-go-to-target Javascript?Jquery: Why Doesn't Jquery.inarray() Work? Post a Comment for "$setpristine() Method In Angular 1.2.1 Doesn't Appear To Work As Intended"
Post a Comment for "$setpristine() Method In Angular 1.2.1 Doesn't Appear To Work As Intended"