-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