1
ng-controller="..."
定义控制器
如ng-controller="firstController"
在js中的代码
firstController = function($scope){
$scope.name = "小明"
}
$scope
是作用域
[github中的代码][1]
[1]:https://github.com/liguoqinjim/learnAngularJs/tree/dev/code/003
ng-controller="..."
定义控制器
如ng-controller="firstController"
在js中的代码
firstController = function($scope){
$scope.name = "小明"
}
$scope
是作用域
[github中的代码][1]
[1]:https://github.com/liguoqinjim/learnAngularJs/tree/dev/code/003