摘要: 简单模拟了一下angularjs的DI.注入器,简单思路: 1 Injector容器供用户注入 2 监听onload事件,找到controller,然后执行对应方法var Injector = (function(){ window.onload = compile; function compile(){ $("[controller]").each(function(ctrl){ var methodName = $(this).attr("controller"); var method ... 阅读全文
posted @ 2013-09-09 19:29 _SharpCode 阅读(211) 评论(0) 推荐(0) 编辑