Enter value auto caps in editable-text using angularjs

巧了我就是萌 提交于 2019-12-13 02:55:38

问题


hi all i am using angularjs editable-text i am trying to do when i enter the in editable-text that value should be changed to uppercase while i typing but i am not able to get my need anyone can help

here i attached my fiddle :http://jsfiddle.net/ckosloski/NfPcH/19035/


回答1:


add this in your controller

 $scope.convertToUpperCase = function(user){
        user.name = user.name.toUpperCase();
  }

and call it on onshow

  <a href="#" editable-text="user.name" onshow="convertToUpperCase(user)">{{ user.name || 'empty' }}</a>

see this http://jsfiddle.net/NfPcH/19577/



来源:https://stackoverflow.com/questions/44568522/enter-value-auto-caps-in-editable-text-using-angularjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!