angularjs force uppercase in textbox

前端 未结 14 1830
情歌与酒
情歌与酒 2020-11-30 20:47

I\'ve tried using the uppercase filter but it does not work. I\'ve tried doing it two ways:


<         


        
14条回答
  •  难免孤独
    2020-11-30 21:03

    I would just use the filter itself in the controller:

     $filter('uppercase')(this.yourProperty)
    

    just keep in mind that, if you you are going to use it inside a controller, for example, you need to inject this filter:

    app.controller('FooController', ['$filter', function($filter) ...
    

提交回复
热议问题