-1
我是AngularJS的新手,所以请原谅我这个转储问题。 我有错误通过点击donot工作角js警报
Cannot set property 'test' of undefined
angularjs
var App = angular.module('StartModule', []);
App.controller('ModalDemoCtrl', [
function($scope) {
$scope.test = function() {
alert("12312");
}
}
]);
HTML
<body ng-app="StartModule">
<div ng-controller="ModalDemoCtrl">
<div ng-click="test()">11111</div>
</div>
<body>
下一次,请在问问题之前,彻底检查你对像这样基本的错误文档代码。 – mrahhal