javascript - How can I get my script to execute on a textbox input change in AngularJS? -


i'm using farbtastic color picker change values in html input text box. have programmed when hex value inside text box changed, supposed execute javascript function converts hex value rgb , sends device changes color of led light. i've tested using button perform script, i'm function isn't problem

here's relevant html code:

<div id="colorpicker"></div>         <md-input>             <md-input-container>                 <label>color</label>                 <input type="text" id="color" name="color" value="#123456" ng-model="color" ng-change="return hextorgb(document.getelementbyid('color').value);"/>             </md-input-container>         </md-input> 

the ng-change seems root of issue. there need change here? or there else needs fixed?

remove return keyword.

change:

ng-change="return hextorgb(document.getelementbyid('color').value);"

to:

ng-change="hextorgb(document.getelementbyid('color').value);"


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -