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 ...
随机推荐
- Flex编程注意之直接获取某个组件的对象(this[]用法)通过id获取控件
有这样一个需求:假如你new了一百次Button,同时这些button的id分别赋值如btn1.id = "button1"; btn2.id = "button2&qu ...
- Jquery ajax 绑定multiselect多选下拉选项,同时异步执行返回值
Jquery ajax 绑定multiselect多选下拉选项,同时异步执行获取返回值 function load(mslt_employees,belongto,mark) {//传入$(#ID) ...
- 32位Windows7上8G内存使用感受+xp 32位下使用8G内存 (转)
32位Windows7上8G内存使用感受+xp 32位下使用8G内存 博客分类: Windows XPWindowsIE企业应用软件测试 我推荐做开发的朋友:赶快加入8G的行列吧....呵呵..超爽 ...
- 关于MonoDevelop自动缩进的设置
monoDevelop 下载地址:http://monodevelop.com/Download 下载安装之后,可在unity Edit->Preference->External Too ...
- Android开发 Unity3D基础 Android Development
开发环境 Window 7 Unity3D 3.3.0 MB525 defy Android 2.1-update1 本次学习: 1.认识Unity 2.Unity3D环境搭建与Android软件生成 ...
- Web service是什么?(转)
我认为,下一代互联网软件将建立在Web service(也就是"云")的基础上. 我把学习笔记和学习心得,放到网志上,欢迎指正. 今天先写一个最基本的问题,Web service到 ...
- php demo
//上一周最后一天,上一个月最后一天: $y = date('Y',strtotime($endTime)); $m = date('m',strtotime($endTime)); ...
- win7配置nginx+php步骤
1.下载nginx: http://www.nginx.cn/nginx-download 2.下载php : http://www.php.net/downloads.php (线程安全与非安全参 ...
- 基于jQuery带图标的多级下拉菜单
之前为大家分享了很多导航菜单.今天我们要来分享一款很不错的jQuery左侧带小图标的多级下拉菜单,菜单是垂直的,每一个菜单项带有一个小图标,看起来非常专业.并且菜单支持无限极下拉,所以对各位Web开发 ...
- HTTP权威指南学习心得
一.HTTP请求的步骤: 1.从url中读取主机名 2.利用DNS(domain name service)对主机名进行转换,得到IP地址 3.如果有端口号的话,读取端口号 4.根据IP地址和端口号, ...