Uncaught Error: [$injector:modulerr] Failed to instantiate module myModule due to: Error: [$injector:nomod] Module 'myModule' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.無法實例化模塊Mymodule中
<head>
<script src="Scripts/angular.js"></script>
<script src="Scripts/Script.js"></script>
</head>
<body ng-controller="myController">
<div>
<table>
<thead>
<tr>
<th>Name</th>
<th>Likes</th>
<th>DisLikes</th>
<th>Likes/DisLikes</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="technology in technologies">
<td>{{ technology.name }}</td>
<td>{{ technology.likes }}</td>
<td>{{ technology.dislikes }}</td>
<td>
<input type="button" value="Like" ng-click="incrementLikes(technology)">
<input type="button" value="Dislike" ng-click="incrementDislikes(technology)">
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
var app = angular.module("myModule", [])
app.controller("myController", function($scope){
var technologies = [{name:"C#", likes:0, dislikes:0},
{name:"ASP.NET", likes:0, dislikes:0},
{name:"SQL Server", likes:0, dislikes:0},
{name:"Angular JS", likes:0, dislikes:0},];
$scope.technologies = technologies;
$scope.incrementLikes = function(technology){
technology.likes++;
}
$scope.incrementDislikes = function(technology){
technology.dislikes++;
}
});
我們不能幫你,除非你發佈的script.js文件,以及... – Gal
它已經下面給出 –