随笔分类 -  angularjs

some empirical value of me when i use it.
摘要:angular里的service是一个单例对象,在应用生命周期结束的时候(关闭浏览器)才会被清除。而controllers在不需要的时候就会被销毁了。 factory是angular里的一种service. Angular里面创建service最简单的方式是使用factory()方法。 例子 什么时 阅读全文
posted @ 2016-08-25 15:09 wifix 阅读(8373) 评论(0) 推荐(2)
摘要:1.首先我们创建一个模块 var module = angular.module( "my.new.module", [] );2.然后写具体的service 可以看到它是一个很有趣的对象 ,以键值对的方式定义属性和值, 值可能是数组,json对象数组,或者函数appServices.service... 阅读全文
posted @ 2015-10-08 19:14 wifix 阅读(2553) 评论(0) 推荐(0)
摘要:angularjs的一些使用经验总结,此篇文章单谈ng指令之一ngrepeat1. ngrepeat 时报错 Duplicates in a repeater are not allowed,正常的时候,我们表达式内的数据是类似这样的(这时不会有任何问题){{answer}} 但一旦当我们表达式的数... 阅读全文
posted @ 2015-09-28 15:20 wifix 阅读(919) 评论(0) 推荐(0)