part 3 Controllers in AngularJS
2016-01-04 06:06
549 查看
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
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"; });
相关文章推荐
- 深入浅析AngularJS中的module(模块)
- 详解AngularJS中的filter过滤器用法
- 深入探究AngularJS框架中Scope对象的超级教程
- AngularJS Best Practices: ng-include vs directive
- Angular相关
- Angularjs + Requirejs 完整的手脚架
- 【AngularJS学习笔记】Java Script "use strict" 严格模式
- Angulars Controller作用域继承
- AngularJS 教程 - CodePreject
- AngularJS 最常用的功能
- 自定义AngularJS中的services服务
- AngularJS web应用程序
- AngularJS进阶(二十四)AngularJS与单选框及多选框的双向动态绑定
- AngularJS进阶(二十四)AngularJS与单选框及多选框的双向动态绑定
- angular问题
- Angularjs 中的 controller
- Angularjs 开始之Hello world
- 初识 Angularjs1.x ,了解5个W和1个H
- Angularjs自定义指令之复制指令
- AngularJS基础——样式指令、DOM操作指令及其它重要指令