【发布时间】:2018-01-05 04:31:58
【问题描述】:
我正在开发一个简单的 AngularJs 应用程序。我在我的项目中使用 cloud9 作为 Ide 并通过 bower 安装 Angular,但在我的 .js 文件中仍然出现“角度未定义”错误。 这是我的代码,请帮助我。
index.html
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>BlogIt!</title>
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-controller="myCtrl">
{{message}}
</body>
</html>
app.js
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.message = "Welcome to BlogIt!";
})
【问题讨论】:
-
@31piy 您已在编辑中添加了 ng-app,现在问题不再存在
-
@Sajeetharan -- 我没有。请看历史。 OP 已经有了,但是因为没有格式化所以不可见。
标签: javascript angularjs html aws-cloud9