随笔分类 -  t_AngularJS

摘要:http://www.angularjs.cn/A09C以下方式会创建新的子作用域,并且进行原型继承:ng-repeat、ng-include、ng-switch、ng-view、ng-controller, 用scope: true和transclude: true创建directive。以下方式... 阅读全文
posted @ 2015-11-04 21:43 Lancelot.Lee 阅读(128) 评论(0) 推荐(0)
摘要:在service里面当我们仅仅需要的是一个方法和数据的集合且不需要处理复杂的逻辑的时候,factory()是一个非常不错的选择。注意:需要使用.config()来配置service的时候不能使用factory()方法service()方法很适合使用在功能控制比较多的service里面注意:需要使用.... 阅读全文
posted @ 2015-10-16 17:56 Lancelot.Lee 阅读(165) 评论(0) 推荐(0)
摘要:link函数主要用来为DOM元素添加事件监听、监视模型属性变化、以及更新DOM。compile 函数在 link 函数被执行之前用来做一些DOM改造。compile 函数不能访问 scope,并且必须返回一个 link 函数。但是如果没有设置 compile 函数,你可以正常地配置 link 函数,... 阅读全文
posted @ 2015-10-14 16:56 Lancelot.Lee 阅读(200) 评论(0) 推荐(0)