2014年3月月 发布的文章

angular开发相关资料

angular开发相关资料
bootstrap::UI组件      弹出层
http://angular-ui.github.io/bootstrap/
jquery easyUI:UI组件     表格
http://www.zi-han.net/case/easyui/
angular api文档:
http://docs.angularjs.org/api/
angular的依赖注入需要注意,必须参数名称一致,否则依赖注入失败,会提示找不到“提供者”,

Error: $injector:unpr
Unknown Provider

意思是:找不到被注入的内容,确认是否定义或者拼写是否正确。(make sure the dependency is defined and spelled correctl)
参看:http://docs.angularjs.org/error/$injector/unpr
而且bootstrap这个组件里的Modal的open方法也是支持angular的依赖注入的,必须查看资料才能找到各种参数是干什么用的:
声明controller:

controller - a controller for a modal instance - it can initialize scope used by modal. A controller can be injected with $modalInstance

声明参数:

resolve - members that will be resolved and passed to the controller as locals; it is equivalent of the resolve property for AngularJS routes

参看:http://angular-ui.github.io/bootstrap/
最后追查到确实是controller中参数定义名称和resolve中的参数名称不符合,导致依赖注入失败。

javascript基本语法

改变 HTML 属性
如需改变 HTML 元素的属性,请使用这个语法:

document.getElementById(id).attribute=new value

本例改变了 元素的 src 属性:

<img id="image" src="smiley.gif" alt="" />
<script type="text/javascript">
document.getElementById("image").src="landscape.jpg";
</script>

改变 HTML 样式
如需改变 HTML 元素的样式,请使用这个语法:

document.getElementById(id).style.property=new style

下面的例子会改变
元素的样式:

Hello World!
<script type="text/javascript">
document.getElementById("p2").style.color="blue";
</script>