我正在使用下面的示例,但它没有打印$event
中定义的值
以下是我的app.js
var myModule = angular.module("myModule",[])
myModule.controller("myController",function($scope){
$scope.someName = "test";
})
以下是我的HTML
<html ng-app="myModule">
<head></head>
<body>
<div ng-controller="myController">
This is Angular JS {{ someName }}
</div>
</body>
</html>
答案 0 :(得分:1)
您的代码没有问题。请确保您已提及 angularjs
参考,如下所示
<强>样本强>
var myModule = angular.module("myModule",[])
myModule.controller("myController",function($scope){
$scope.someName = "test";
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<html ng-app="myModule">
<head></head>
<body>
<div ng-controller="myController">
This is Angular JS {{ someName }}
</div>
</body>
</html>
&#13;