美文网首页前端笔记本
过滤字段小技巧

过滤字段小技巧

作者: 大乔是个美少女 | 来源:发表于2017-08-17 17:49 被阅读5次
    $scope.changeWordLists = ->
            find_word = $.trim($scope.find_word.toLowerCase())
    
            if find_word.length == 0
                return $scope.words_for_show = words
    
            find_word = find_word.split(/\s+/g)
            words_for_show = []
            for word in (words or [])
                name = word.name.toLowerCase()
                if name.indexOf($scope.find_word) > -1
                    words_for_show.push word
    
            $scope.words_for_show = words_for_show
    

    相关文章

      网友评论

        本文标题:过滤字段小技巧

        本文链接:https://www.haomeiwen.com/subject/akenrxtx.html