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 ?
- validate field after form submission ?
- removing min-tags="1" , find way check required aspect.
- 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>
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
Post a Comment