zoukankan      html  css  js  c++  java
  • angular 搜索记录保留

     1   #方法1:   点击后退到home后,再点击搜索, locationChangeStart 事件会多次触发。
     2   # $scope.keyword =  $location.search().search
     3   # $scope.search = ()->
     4   #   return if $scope.isSearching
     5   #   return unless $scope.sitetype and $scope.keyword
     6   #   $location.search({search: $scope.keyword})
     7 
     8   #   if $scope.sitetype == 'site'
     9   #     $scope.doSearch()
    10   #   else
    11   #     $scope.connectSocket($scope.doSearch)
    12 
    13   # #有关键词的时候,执行搜索任务
    14   # if $scope.keyword
    15   #   $scope.search()
    16 
    17   # $rootScope.$on '$locationChangeStart', (e, next, current)->
    18   #   console.log 'locationChangeStart...'
    19   #   $scope.keyword =  $location.search().search
    20   #   $scope.search()
    21 
    # 方法2 路由: url: '/search/*path' 22 $scope.keyword = $location.path().slice(8) 23 $scope.setPath = (keyword)-> 24 if !keyword 25 keyword = $scope.keyword 26 $location.path('/search/'+keyword)
       #搜索
        if $scope.keyword
           $scope.search()
  • 相关阅读:
    codeforces
    codeforces
    HDU
    poj
    poj
    HDU Problem
    HDU 3555 Bomb 【数位dp】
    POJ 1942 Paths on a Grid【组合数学】
    杭电 Problem 2089 不要62 【数位dp】
    codeforces 486c-Palindrome Transformation【贪心】
  • 原文地址:https://www.cnblogs.com/wanqiu/p/4788367.html
Copyright © 2011-2022 走看看