in angular 1.3.0 u have to do like below, Because Global controllers were disabled in 1.3.0-beta.reference
<div id="tableAFS" ng-app="myApp" ng-controller="personController">
<table class="allDiv" ng-repeat="item in items">
<td>{{$index + 1}}</td>
<td>{{item.name}}</td>
<td>{{item.price | currency}}</td>
<td><input ng-model="item.quantity"></td>
<td>{{item.quantity * item.price | currency}}</td>
<td>
<button ng-click="remove($index)">Remove</button>
</td>
</table>
<script>
var app = angular.module("myApp",[]);
app.controller(‘personController‘, function($scope){
$scope.firstName = "David";
$scope.lastName = "Silva";
$scope.items = [
{ name: "雷柏(Rapoo) V500 机械游戏键盘 机械黄轴", quantity: 1, price: 199.00 },
{ name: "雷柏(Rapoo) V20 光学游戏鼠标 黑色烈焰版", quantity: 1, price: 139.00 },
{ name: "AngularJS权威教程", quantity: 2, price: 84.20 }
];
})
</script>
It also said that you can get the older behavior by using below code , but its not recomended
<div ng-app="myApp" ng-controller="personController">
var app = angular.module("myApp",[]).config([‘$controllerProvider‘, function($controllerProvider) {
$controllerProvider.allowGlobals();
}]);
function personController($scope) {
$scope.firstName = "David";
$scope.lastName = "Silva";
}