0
我正嘗試在使用ngmodal的angularjs中實現模態彈出窗口。代碼運行時,瀏覽器控制檯上沒有返回錯誤,但單擊模式時沒有任何反應。下面是我的嘗試和代碼ngDialog單擊時未顯示模式,瀏覽器控制檯上未顯示任何錯誤
index.html文件
<html ng-appp="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js">
<script src="ngDialog.js"></script>
<link src="ngDialog.css"></link>
<script src="ngDialog.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<div ng-controller="MyCtrl">
<button ng-click="clickToOpen()">My Modal</button>
<script type="text/ng-template" id="templateId">
<div id="target" ng-click="test()" ng-controller="tt">
Click here
</div>
</script>
</div>
</body>
</html>
app.js文件
var myApp = angular.module('myApp',['ngDialog']);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope, ngDialog) {
$scope.clickToOpen = function() {
ngDialog.open({ template: 'templateId' });
};
}
function tt($scope)
{
$scope.test = function()
{
console.log("AaA");
}
}
來源教程http://jsfiddle.net/mb6o4yd1/6/ 的請協助