每次保存myApp.js
CodeKit都會給我一個警告。當我通過CodeKit預覽加載index.html時,firstName
和lastName
變量顯示正常。我只想讓這個問題消失。使用Codekit時未定義'angular'
"var app = angular.module("myApp", []);
'angular' is not defined"
這裏是我的兩個文件index.html
和myApp.js
的index.html:
<html>
<script src="angular/angular.js"></script>
<script src="myApp.js"></script>
<body ng-app="myApp" ng-controller="myCtrl">
<div>
{{ firstName + " " + lastName }}
</div>
</body>
</html>
myApp.js:
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.firstName = "John";
$scope.lastName= "Doe";
});
你有沒有試圖把NG-應用= 「對myApp」 在標籤? –
這與ng-app無關@RenanLopesFerreira –
@RenanLopesFerreira是的,我剛剛嘗試過,我仍然收到警告。 – jakethecool1