var MainController = function($scope){
$scope.message = "Hello angularJS";
}

<!DOCTYPE html>
<html ng-app>
<head>
<script data-require="angular.js@*" data-semver="2.0.0" src="https://code.angularjs.org/2.0.0-snapshot/angular2.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-controller="MainController">
<h1>Hello Plunker!</h1>
<h1>{{message}}</h1>
</body>
</html>
&#13;
请帮助我并指导我......我,请初学者...
答案 0 :(得分:0)
您必须定义ImageView
。在ng-app
代码
ng-app
更改为ng-app="app"
将<html>
更改为
script.js
答案 1 :(得分:0)
您需要定义ng-app名称。
使用此代码html代码
<script src="angular.min.js"></script>
<script src="hello_world_controller.js"></script>
<div ng-app="HelloWorldApp">
<div ng-controller="HelloWorldController">
<h1>{{greeting}}</h1>
</div>
</div>
javascript代码
angular.module('HelloWorldApp', [])
.controller('HelloWorldController', function($scope) {
$scope.greeting = "Hello World";
});