了解 controller
译文:
指令的基本信息
This directive creates new scope.
This directive executes at priority level 500.
译文:
指令会创建一个 scope 即作用域
什么时候使用 controller
当我们须要一个新的模块而且不希望它跟其它模块的数据产生冲突的情况下。我们就能够使用一个 ngController 来独立这一块的内容,比方我们的文章正文模块能够使用 ng-controller=”AricleController”。而文章中的评论模块则能够使用 ng-controller=”CommentController” 来完毕