ng tags input - ngTagsInput issue with ng-invalid style -


i'm using https://github.com/mbenford/ngtagsinput.
created basic form url , tag-input field required. since it's required, used attribute min-tags="1"

i used in conjonction bootstrap stylehseet.

when displayed, field appears red shadow border (since empty), before submit of form. annoying, there workaround ?

  1. validate field after form submission ?
  2. removing min-tags="1" , find way check required aspect.
  3. playing css discard styles applied .ng-invalid .tags

thank you

edit : sample code :

<tags-input min-tags="1" ng-model="mytags"></tags-input> 

have done plunker : http://plnkr.co/edit/eqcyfr4vlpkejesho3gl?p=preview

you can use custom class handle pristine state:

css

.custom-tags.ng-pristine .tags {   box-shadow: inset 0 1px 1px rgba(0,0,0,.075);   border: 1px solid #ccc } 

html

<tags-input min-tags="1" ng-model="mytags" class="custom-tags"></tags-input> 

working plunker

also, angular 1.3 isn't officially supported yet. particularly important here because both pristine , dirty states won't correctly set if use version of framework.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -