UNPKG

angular-material-npfixed

Version:

The Angular Material project is an implementation of Material Design in Angular.js. This project provides a set of reusable, well-tested, and accessible Material Design UI components. Angular Material is supported internally at Google by the Angular.js, M

49 lines (41 loc) 1.1 kB
(function() { var isDlgOpen; angular .module('toastDemo2', ['ngMaterial']) .controller('AppCtrl', function($scope, $mdToast) { $scope.showCustomToast = function() { $mdToast.show({ hideDelay : 3000, position : 'top right', controller : 'ToastCtrl', templateUrl : 'toast-template.html' }); }; }) .controller('ToastCtrl', function($scope, $mdToast, $mdDialog) { $scope.closeToast = function() { if (isDlgOpen) return; $mdToast .hide() .then(function() { isDlgOpen = false; }); }; $scope.openMoreInfo = function(e) { if ( isDlgOpen ) return; isDlgOpen = true; $mdDialog .show($mdDialog .alert() .title('More info goes here.') .textContent('Something witty.') .ariaLabel('More info') .ok('Got it') .targetEvent(e) ) .then(function() { isDlgOpen = false; }); }; }); })();