This lessons implements the Search Pipe with a new SearchBox component so you can search through each todo. It also demonstrates the patterns used for components to interact with each other. Often generic components are used for handling user input t…
As you know, I've been playing with Solr lately, trying to see how feasible it would be to customize it for our needs. We have been a Lucene shop for a while, and we've built our own search framework around it, which has served us well so far. The ra…
angular的filter filter两种用法 1.在模板中使用filter {{expression|filter}}//基本用法 {{expression|filter1|filter2|filter3}}//多个过滤器,上一段输出为下一段输入 {{expression|filter:args1,args2,...}}//带参数 除了使用简单的表达式,还可以在ng-repeat中使用,在这里我们获得处理的对象是一个数组,或者对象,不是单个的item <span ng-repeat="…
用modul.filter .filter("fiilterCity",function(){ return function(obj){ var newObj = []; angular.forEach(obj,function(o){ if(o.city === "上海"){ newObj.push[o] } }) return newObj } })…
今天突然想把博客的搜索改为google的站内搜索,印象中google adsense中好像提高这个站内搜索的代码,但苦逼的是google adsense帐号一直审核不通过,所以只能通过google custom search api了. 好不容易把相关代码写好了,但后来发现这个接口对免费用户是有限制的,每天只能最多100个请求,气愤啊…也怪自己在申请api的时候没有仔细看清说明: 附上接口代码: Click Me! 把请求URL中的key.cx值修改成自己的,搜索结果样式比较乱,自己调整. 有了…
Preloading all modules is quite an extreme approach and might not always be desirable. For instance, you don't want to preload lazy routes a user might not even have access to. Therefore, in this lesson we're going to have a look at how to define a c…
参考 : https://stackoverflow.com/questions/29979609/time-conversion-with-timezoneinfo-for-past-years https://nodatime.org/ 不常出国的人对 timezone 可能感到陌生. 我就是这样...哈哈 这篇特地做了一些整理. 首先说说准备的资料 : 1. offset != timezone offset 是说 +08:00, -03:00, 它表示某个时间和 UTC 的时差. tim…
传统的 angular 应用不支持异步加载模块,必须在 module 启动的时候,所有模块必须预加载进来. 通过使用 angular-async-loader 库,我们可以使用 requirejs 等加载器,在 module 初始化之后,在动态异步加载其他的 Controller, Services, Filters 等等... Angular.JS + Require.JS + angular-async-loader 来实现异步加载 angular 模块…
首先,列表绑定忽略 先上代码 <html ng-app="app1"> <head> <meta charset='utf-8' /> <meta name="generator" content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" /> <…
首先,介绍下$filter服务: 1.$filter是用来进行数据格式化的专用服务: 2.AngularJS内置了currency.date.filter.json.limitTo.lowercase.uppercase.number.orderBy这8个filter: 3.filter可以嵌套使用,用管道符号"|"来分隔(有点像linux): 4.filter可以传递参数: 5.用户可自定义filter.   介绍下内置filter: currency:用于格式化货币,如在数值前自动…