我只是试图链接我的" GameController"在Angular中,它不断吐出上述错误。 Haven没有把任何东西放在范围内,但我不确定我的控制器有什么问题。有什么建议?这是一个基本的Tic Tac Toe游戏。
JS:
// module
var xoxoApp = angular.module('xoxoApp', []);
// defines controller
xoxoApp.controller('GameController', function ($scope) {
$scope.boxes = []
});
HTML:
<!DOCTYPE html>
<html ng-app="xoxoApp">
<head>
<link rel="stylesheet" type="text/css" href="xoxo.css">
<script src="angular.min.js"></script>
<script src="xoxo.js" type="text/javascript"></script>
<title>Tic Tac Toe</title>
</head>
<body>
<div ng-controller="GameContoller">
<div id="container">
<div class= "squares" id="box1" onclick="clickBox('box1')"></div>
<div class= "squares" id="box2" onclick="clickBox('box2')"></div>
<div class= "squares" id="box3" onclick="clickBox('box3')"></div>
<div class= "squares" id="box4" onclick="clickBox('box4')"></div>
<div class= "squares" id="box5" onclick="clickBox('box5')"></div>
<div class= "squares" id="box6" onclick="clickBox('box6')"></div>
<div class= "squares" id="box7" onclick="clickBox('box7')"></div>
<div class= "squares" id="box8" onclick="clickBox('box8')"></div>
<div class= "squares" id="box9" onclick="clickBox('box9')"></div>
</div>
</div>
</body>
</html>
答案 0 :(得分:6)
你拼错了GameController
吗?