angular.js - When angular uses ng-change to monitor the input box, input Chinese and get the value twice, which are Pinyin and the corresponding Chinese.
滿天的星座
滿天的星座 2017-05-15 17:05:06
0
2
714
用ng-model = "searchKPointObj.namepart",绑定在输入框中,并用ng-change监听,每当输入框发生变化执行下面请求。
但是在我输入一个字时,比如“将”,这里会请求两遍,请求的参数分别是“jiang”和“将”,有什么解决办法么,不想要拼音的。(在chrome上的)



<input type = "text" placeholder = "请输入关键词" ng-model="searchKPointObj.namepart" ng-change="search()">

//Monitor input box to retrieve knowledge points in real time

function search(){
    sysmanageSer.search(searchKPointObj,function(da){

    });
}
滿天的星座
滿天的星座

reply all(2)
世界只因有你

ng-change will be executed every time the data changes. It cannot be executed once for pinyin and once for Chinese characters. Isn’t it a problem with ng-change? I think there should be something wrong with the method you requested later

迷茫

You can try setting an input time interval. ng-model-options={debounce : 1000} How long to delay execution after input stops.
Or filter out Pinyin directly in the search() function

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template