摘要: ng-show:ng-show element will stay in dom, just added a ng-hide attr, so it won't show.ng-if:It has its own scope.Element is not display in the dom if ... 阅读全文
posted @ 2015-11-12 03:27 Zhentiw 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Convenient method to find one item in an array, avoid writing and for + if:let arys = [1,,5,,6] ;let target = 6;let res = arys.find(item => item === t... 阅读全文
posted @ 2015-11-12 03:23 Zhentiw 阅读(544) 评论(0) 推荐(0) 编辑
摘要: In es5, you can use indexOf to get the index of one item in an array.In es6, you can use findIndex(), which is more prowful:[NaN].indexOf(NaN) // -1[N... 阅读全文
posted @ 2015-11-12 03:16 Zhentiw 阅读(599) 评论(0) 推荐(0) 编辑
摘要: Best Pratices for Object.assign: http://www.cnblogs.com/Answer1215/p/5096746.html Object.assign() can extend the object by adding new props: let obj = 阅读全文
posted @ 2015-11-12 03:13 Zhentiw 阅读(614) 评论(0) 推荐(0) 编辑