part 3 Controllers in AngularJS
What happens if the controller name is misspelled?
When the controller name is misspelled, 2 things happen
1, An error is raised. To see the error, use brower develepertools
2, The binding expressions in the view that are in the scope of the controller will not be evaluated
What happens if a property name in the binding expression is misspelled?
Expression evaluation in angular is forgiving, meaning if you misspell a property name in the binding expression, angular will not report any error, It will simply return null or undefined.
How to create module, controller and register the controller with the module, all in one line?
Use the method chaining(链接) mechanism(机制) as shown below
var myApp = angular
.module("myModule",[])
.controller("myController",function($scope){
$scope.message = "create module and controller in one line";
});
part 3 Controllers in AngularJS的更多相关文章
- angularjs 不同的controller之间值的传递
Sharing data between controllers in AngularJS I wrote this article to show how it can possible to pa ...
- AngularJS基础总结
w3shools angularjs教程 wiki <AngularJS权威教程> Introduction AngularJS is a JavaScript framewo ...
- angularJS和requireJS和angularAMD
最近因为要用到angularJS开发项目,因为涉及到的静态资源比较多,所以想把js文件通过requireJS来按需加载,这两个框架以前都使用过,但是结合到一起还没有用过,那就试一下,看能否达到目的. ...
- (译)AngularJS1.3.0 开发者指南(四) -- 控制器
理解Controllers 在AngularJS中, Controller是一个Javascript构造函数, 常常被用来扩展 Angular Scope 对象. 控制器通过 ng-controlle ...
- ABP框架系列之二十二:(Dynamic-Web-API-动态WebApi)
Building Dynamic Web API Controllers This document is for ASP.NET Web API. If you're interested in A ...
- Angular1.x 基础总结
官方文档:Guide to AngularJS Documentation w3shools angularjs教程 wiki <AngularJS权威教程> Introd ...
- AngularJs学习笔记--Injecting Services Into Controllers
原版地址:http://docs.angularjs.org/guide/dev_guide.services.injecting_controllers 把service当作被依赖的资源加载到con ...
- [译]在AngularJS中何时应该使用Directives,Controllers或者Service
原文: http://kirkbushell.me/when-to-use-directives-controllers-or-services-in-angular/ Services Servic ...
- [AngularJS - thoughtram] Exploring Angular 1.3: Binding to Directive Controllers
The post we have: http://www.cnblogs.com/Answer1215/p/4185504.html gives a breif introduce about bin ...
随机推荐
- MON166 User's Guide
MON166 is a debug monitor for C16x and ST10 user programs. It consists of: A configurable monitor pr ...
- 如何自学Java 经典
JAVA自学之路 JAVA自学之路 一:学会选择 为了就业,不少同学参加各种各样的培训. 决心做软件的,大多数人选的是java,或是.net,也有一些选择了手机.嵌入式.游戏.3G.测试等. 那么究竟 ...
- C#与excel互操作的错误无法将类型为“Excel.ApplicationClass”的COM 对象强制转换为接口类型“Excel._Application”
如果您使用的电脑要操作的是office2003而之前使用过office2007使用此方法可解决您的问题 无法将类型为“Microsoft.Office.Interop.Excel.Applicatio ...
- 由“大数据量Excel入库高效方式”瞥见“并联系统”之优势
使用场景: 当你有一个Excel文件,需要把其中的数据高速录入到数据库中,文件中包含10万条以上数据. 设计方案: 我们将整个过程分成三个阶段,A(装载Excel文件). ...
- JQUERY插件JqueryAjaxFileUplaoder----更简单的异步文件上传
异步上传相信大家都做过类似的功能,JqueryAjaxFileUploader为我们提供了更简单的实现和使用方式.不过既然是JQUERY的插件那么它所依赖的环境大家都懂得.JqueryAjaxFile ...
- easy Html5 - Jquery Mobile之ToolBars(Header and Footer)
jquery 在web js框架上的风暴还在继续却也随着移动终端走向了mobile:那么jquery mobile到底包括些什么呢 简介工具栏是在移动网站和应用中的头部,尾部或者内容中的工具条:Jqu ...
- C# Redis分布式缓存
C# Redis实战(七) 七.修改数据 在上一篇 C# Redis实战(六)中介绍了如何查询Redis中数据,本篇将介绍如何修改Redis中相关数据.大家都知道Redis是key-value型存储系 ...
- Java Web系统经常使用的第三方接口
1. Web Service 接口 1.1 接口方式说明和长处 在笔者的开发生涯中,当作为接口提供商给第三方提供接口时,以及作为client去调用第三方提供的接口时,大部分时候都是使用 Web Se ...
- Swift2.0 中的String(一):常用属性
字符串算是平常用的比较多.花样也比较多的一个类型,昨天有空把相关的一些常用操作都写了一遍,总结出来.其实iOS里面的字符串更复杂,还有NSString系列等等,那些API太多将来需要用的时候再慢慢学. ...
- GXPT(一)——UI设计
通过长时间的积淀.TGB再次開始GXPT模式,JAVA版..NET版两条线同一时候进行. 纯面向对象的底层架构的搭建:easyUI+MVC的界面设计:工作流的再次雄起.云平台的构想:Confluenc ...