JAVASCRIPT
(function () {
'use strict';
angular
.module('MyApp', ['ngMaterial'])
.controller('AppCtrl', function($mdDialog) {
var vm = this;
vm.moreInfo = function moreInfo(thing) {
$mdDialog.show({
controllerAs: 'dialogCtrl',
clickOutsideToClose: true,
bindToController: true,
controller: function($mdDialog) {
this.click = function() {
$mdDialog.show({
controllerAs: 'dialogCtrl',
controller: function($mdDialog) {
this.click = function() {
$mdDialog.hide();
};
},
preserveScope: true,
autoWrap: true,
skipHide: true, // this line does the trick
template: '<md-dialog class="confirm"><md-conent><md-button ng-click="dialogCtrl.click()">I am in a 2nd dialog!</md-button></md-conent></md-dialog>'
});
};
},
autoWrap: false,
template: '<md-dialog class="stickyDialog" data-type="{{::dialogCtrl.thing.title}}"><md-conent><md-button ng-click="dialogCtrl.click()">I am in a dialog!</md-button></md-conent></md-dialog>',
locals: {
thing: thing
}
});
};
});
})();