angular 搜索记录保留
#方法1: 点击后退到home后,再点击搜索, locationChangeStart 事件会多次触发。
# $scope.keyword = $location.search().search
# $scope.search = ()->
# return if $scope.isSearching
# return unless $scope.sitetype and $scope.keyword
# $location.search({search: $scope.keyword}) # if $scope.sitetype == 'site'
# $scope.doSearch()
# else
# $scope.connectSocket($scope.doSearch) # #有关键词的时候,执行搜索任务
# if $scope.keyword
# $scope.search() # $rootScope.$on '$locationChangeStart', (e, next, current)->
# console.log 'locationChangeStart...'
# $scope.keyword = $location.search().search
# $scope.search()
# 方法2 路由: url: '/search/*path'
$scope.keyword = $location.path().slice(8)
$scope.setPath = (keyword)->
if !keyword
keyword = $scope.keyword
$location.path('/search/'+keyword)
#搜索
if $scope.keyword
$scope.search()
angular 搜索记录保留的更多相关文章
- iOS 搜索记录
需求描述: 使用单独的搜索界面, 提供用户进行搜索并留下搜索记录. 搜索记录可以提供用户进行再次搜索, 或者把搜索记录清空. 方案和技术点: 存储方式使用 NSUserDefaults, 把对应的字段 ...
- js实现搜索记录列表
<div class="sy_div28"> <div class="sy_div23"> <span>搜索历史</s ...
- elastic search6.2.2 实现用户搜索记录查询(去重、排序)
elastic search6.2.2 实现搜索记录查询 ,类似新浪微博这种,同样的搜索记录后面时间点的会覆盖前面的(主要思路:关键词去重,然后按时间排序) 先创建索引 //我的搜索 PUT my_s ...
- 微信小程序开发之带搜索记录的搜索框
实现功能:点击搜索框,有搜索记录时以下拉菜单显示,点击下拉子菜单,将数据赋值到搜索框,点击搜索图标搜索,支持清空历史记录,可手动输入和清空查询关键字, UI: wxml: <!--查询历史记录数 ...
- Android 淘宝搜索记录分析及千牛数据库名称关联
一 taobao搜索关键字分析1.导出淘宝数据文件夹.2.搜索search 找到search文件夹.查看里面可疑文件如history_8d4255cc9c9199c6ec3be940936986b9. ...
- mysqlbinlog快速遍历搜索记录 (转)
目标,开发人员说有个数据莫名其妙添加了,但是不知道是从哪里添加的,而且应用功能里面不应该添加这样的数据,为了查清楚来源,所 以我就准备去binlog里面找了,但是binlog有好几个月的数,我这样一个 ...
- 使用localStorage保存搜索记录
//过滤一个结果的空记录添加,过滤空搜索 默认保存10条记录,自己可修改 function setHistoryItems(keyword) { keyword = keyword.replace(& ...
- angular安装记录
1. 安装node.js,下载地址:https://nodejs.org/en/download/,详细的安装教程参考这里:https://blog.csdn.net/u010255310/artic ...
- mysqlbinlog高速遍历搜索记录
目标,开发者说有个数据莫名其妙加入了.可是不知道是从哪里加入的.并且应用功能里面不应该加入这种数据,为了查清楚来源,所以我就准备去binlog里面找了.可是binlog有好几个月的数,我这样一个个my ...
随机推荐
- iOS 如何随意的穿插跳跃,push来pop去
OS 如何随意的穿插跳跃,push来pop去 主题思想:如A.B.C.D 四个视图控制器 想要在 A push B 后, B 在push 到 D ,然后从 D pop 到 C ,在从 C pop 的A ...
- HDU Herding
F - Herding Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Subm ...
- gerrit的merge conflict
找了很多资料,最后参考http://blog.csdn.net/w_jewelry/article/details/8123639 解决的. 先把gerrit的那几个commit abandon掉. ...
- @InitBinde的作用
@InitBinder用于在@Controller中标注于方法,表示为当前控制器注册一个属性编辑器或者其他,只对当前的Controller有效
- IQueryable和IEnumerable,IList的区别
IQueryable和IEnumerable都是延时执行(Deferred Execution)的,而IList是即时执行(Eager Execution) IQueryable和IEnumerabl ...
- 使用 Spark MLlib 做 K-means 聚类分析[转]
原文地址:https://www.ibm.com/developerworks/cn/opensource/os-cn-spark-practice4/ 引言 提起机器学习 (Machine Lear ...
- POJ 2240 Arbitrage(SPFA+邻接矩阵)
( ̄▽ ̄)" #include<iostream> #include<cstdio> #include<cmath> #include<algori ...
- JAVA中计算两个时间相差多少 天,时,分,秒
1: import java.util.Date; 2: 3: public class ShowTimeInterval{ 4: public void ShowTimeInterval(Date ...
- updateMany
db.tblDaily.updateMany( {"Comments.ViewCount":0}, {$addToSet:{"Comments.$.CommentDate ...
- 自定义函数动态执行SQL语句
Oracle 动态SQL有两种写法:用 DBMS_SQL 或 execute immediate,建议使用后者. DDL 和 DML Sql代码 收藏代码 /*** DDL ***/ begin EX ...