Açısal malzemeye yeni geliyorum ve $ md-Dialog servisini çalıştırmaya çalışıyorum. Ben açısal malzemenin demosunu kullanıyorum ama bir şekilde bunu doğru göremiyorum. Bunun işe yaraması için ne ekleyeceğim/neyi yanlış yapıyorum.md dialog çalışmıyor
Demo https://material.angularjs.org/latest/api/service/ $ mdDialog
Benim html
<div ng-controller="myController">
<md-button ng-click="showAlert()" class="md-raised md-warn">Custom Dialog</md-button>
</div>
Benim JS
app.controller('myController', ['$scope', '$mdToast', '$animate', '$mdDialog', '$mdMedia', function ($scope, $mdToast, $mdDialog,$animate, $mdMedia) {
var alert;
$scope.showAlert = showAlert;
// Internal method
function showAlert() {
alert = $mdDialog.alert({
title: 'Attention',
textContent: 'This is an example of how easy dialogs can be!',
ok: 'Close'
});
$mdDialog
.show(alert)
.finally(function() {
alert = undefined;
});
}
}