CodeKit keeps giving me a warning every time I save myApp.js
. When I load index.html via the CodeKit preview the firstName
and lastName
variables appear fine. I just want this issue to go away.
"var app = angular.module("myApp", []);
'angular' is not defined"
Here are my two files index.html
and 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";
});