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 ...
随机推荐
- Codeforces Round #313 (Div. 1) A. Gerald's Hexagon 数学题
A. Gerald's Hexagon Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/p ...
- 关于android 图像格式问题
这算是篇总结吧.6月份开始做的一个android上的ar项目结束了.我做的部分是二维码识别和图像识别的预处理.这个项目虽然很累,但是让我学到了很多东西,特别是严格的编码规则,和java代码的效率优化, ...
- Java读取Properties配置文件
1.Properties类与Properties配置文件 Properties类继承自Hashtable类并且实现了Map接口,使用键值对的形式来保存属性集.不过Properties的键和值都是字符串 ...
- C# Socket基础(一)之启动异步服务监听
本文主要是以代码为主..NET技术交流群 199281001 .欢迎加入. //通知一个或多个正在等待的线程已发生事件. ManualResetEvent manager = new ManualRe ...
- LOCK TABLES
http://blog.csdn.net/zyz511919766/article/details/16342003 http://blog.csdn.net/zyz511919766/article ...
- java Servlet接口及应用
基本类和接口 一.javax.servlet.Servlet接口 servlet抽象集是javax.servlet.Servlet接口,它规定了必须由Servlet类实现由servlet引擎识别和管理 ...
- 给指针malloc分配空间后就等于数组吗?
首先回答这个的问题:严格的说不等于数组,但是可以认为它是个数组一样的使用而不产生任何问题.不过既然这样,那它应该算是个数组吧.所以,一般我们都用“动态数组”这种名字来称呼这种东西. 要讲清楚这个东西, ...
- UIView的生命周期总结
序言: loadView.viewDidLoad.viewDidAppear.initWithNibName.awakeFromNib等经常出现在UIViewController中的方法介绍. 这些方 ...
- iOS runtime 运行时( 三 )
上一篇 聊的是: 在不知道一个对象有什么属性的情况下, 获取对象的所有属性,然后可以改变属性的值, 今天我们谈谈 怎么通过Category(类别)+runtime 给一个类 添加一个新的属性,一般情况 ...
- AliasRegistry接口
Spring - 4.2.3 // 将一个name注册为一个别名aliasvoid registerAlias(String name, String alias);// 移除一个别名aliasvoi ...