我正在尝试连接material angular的对话框。代码如下。我得到错误,Unknown provider: eProvider <- e
.
JS
var app = angular.module('app', ['ngMaterial']);
var dialogController = app.controller('dialogController', ['$scope', '$mdDialog', function($scope, $mdDialog) {
$scope.hide = function () {
$mdDialog.hide();
};
$scope.cancel = function () {
$mdDialog.cancel();
};
$scope.answer = function (answer) {
$mdDialog.hide(answer);
};
}]);
app.controller('mainController', ['$scope', '$http', '$mdDialog', function ($scope, $http, $mdDialog) {
$scope.showDialog = function (e) {
e.preventDefault();
$mdDialog.show({
controller: dialogController,
templateUrl: 'sign-in.html',
targetEvent: e
});
};
}]);
html
<a href="#" ng-click="showDialog($event)">Show dialog</a>
<script type="text/ng-template" id="sign-in.html">
hello there
</script>
我错过了什么吗?