javascript - Clear input text AngularJS -
I am using the glyphicon icon in my input control, when it receives some error, both the error on the glyphine icon and There are correct images but I want to clear the input control when I click on the error glyphin. Below is my code:
& lt; Div class = "{{layout == 'horizontal'? FieldClass || 'col-lg-9': ''}}" & gt; & Lt; Div style = "status: relative" class = "input-group" & gt; & Lt; Span class = "input-group-adon" & gt; & Lt; B & gt; PD & lt; / B & gt; & Lt; / Span & gt; & Lt; Div class = "icon-addo addon-md" & gt; & Lt; Input type = "text" class = "form-control {{textboxClass}}" name = "text control" id = "text control" ng-readingonly = "reading" "ng-required =" required "maximum length =" 10 "Placeholder =" {{placeholder} layout == 'inline'? Label text: ''}} "data-ng-model =" vm.value "ng-blur =" vm.oneburur "/> onclick =" clear control (this, 'text control'); "class =" form-control-feedback "ng-class =" {glyphikon Glyphicon-oak ': vm.state == 2,' glyphicon glyphicon-act ': vm.state == 3} "style =" width: auto; Height: auto; Font-size: 20px; Top: 0; Right: 10px "> Please help
inline Do not use the onclick handler You can clear the input directly with the command: & lt; i ng-click = "vm.value = '' class =" Form-control-feedback "ng-class =" {'glyphicon glyphicon-ok': vm.state == 2, 'glyphicon glyphicon-remove': vm.state == 3} "style =" width: auto; height: Auto; font-size: 20px; top: 0; right: 10px "& gt; & Lt; / I & gt; I recommend cleansing HTML, to move styles into CSS files, this will give you a more comprehensive code.
Comments
Post a Comment