html - Ignore Angular.JS form validation for a single input inside a form -


is there way can this? have form 5 inputs, want 1 of them, not affected ngdirty or ngprestine or of that, there anyway can this? if need more information, please tell me.

some html context:

  <input id="name" ng-model="device.name" type="text" class="form-control">    <input id="description" ng-model="img.description" type="text" class="form-control" />      </form> 

and css done outsider:

input.ng-dirty {   &.ng-invalid   {     border: 1px solid $error;     background-color: transparentize($error, 0.95);   }   &.ng-valid   {     border: 1px solid $success;     background-color: transparentize($success, 0.95);   } }  input.ng-pristine {   &.ng-invalid   {     border: 1px solid $required;     background-color: transparentize($required, 0.95);   }  } 

now basicly, says input element when on dirty or prestige state colors, how ignore single field? let's 'name' field?

you can achieve adding css class disables styling on input fields use it.

the :not() css pseudo-class perfect use.

in css

...  input.ng-pristine:not(.no-change) {     ... }  ... 

the styling apply on elements doesn't have class no-change.

in html

<input id="name" ng-model="device.name" type="text" class="form-control no-change"> <input id="description" ng-model="img.description" type="text" class="form-control" />     

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -