md-autocomplete不更新原始列表

时间:2017-01-15 21:10:45

标签: angularjs angular-material md-autocomplete

Angular material md-autocomplete在点击服务时不更新/刷新原始列表。它按旧列表工作但未更新新列表,因为文本在md-autocomplete中已更改。

<md-autocomplete
              md-no-cache="true"
              md-items="itemz in vm.SearchKeywordList"
              md-selected-item="vm.selectedKeyword"
              md-search-text-change="vm.searchServiceKeyword(vm.searchKeyword)"
              md-search-text="vm.searchKeyword"
              md-selected-item-change="vm.getSeletedService(itemz)"
              md-item-text="itemz.alises"
              md-input-minlength="1">
            <md-item-template>
            <svg style="height:22px;" viewBox="0 0 24 24">
                        <path fill="#888" d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"></path>
                    </svg>
              <span md-highlight-text="vm.searchKeyword" md-highlight-flags="^i">{{itemz.alises}}</span>
            </md-item-template>
            <md-not-found>
                Match not found.
            </md-not-found>
</md-autocomplete>

控制器:

vm.searchServiceKeyword=function(){
factory.searchKeyword(keyword).success(function(data){
            $log.debug("SEARCHING....");
            vm.SearchKeywordList=data.list;
        }).error(function(error){
            console.log(error);
        });
}

0 个答案:

没有答案