all files / app/main/components/material-docs/demo-partials/menu/demoBasicUsage/ script.js

7.69% Statements 1/13
100% Branches 0/0
0% Functions 0/6
7.69% Lines 1/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                                                                            
angular
  .module('menuDemoBasic', ['ngMaterial'])
  .config(function($mdIconProvider) {
    $mdIconProvider
      .iconSet("call", 'assets/angular-material-assets/img/icons/sets/communication-icons.svg', 24)
      .iconSet("social", 'assets/angular-material-assets/img/icons/sets/social-icons.svg', 24);
  })
  .controller('BasicDemoCtrl', function DemoCtrl($mdDialog) {
    var originatorEv;
 
    this.openMenu = function($mdOpenMenu, ev) {
      originatorEv = ev;
      $mdOpenMenu(ev);
    };
 
    this.notificationsEnabled = true;
    this.toggleNotifications = function() {
      this.notificationsEnabled = !this.notificationsEnabled;
    };
 
    this.redial = function() {
      $mdDialog.show(
        $mdDialog.alert()
          .targetEvent(originatorEv)
          .clickOutsideToClose(true)
          .parent('body')
          .title('Suddenly, a redial')
          .textContent('You just called a friend; who told you the most amazing story. Have a cookie!')
          .ok('That was easy')
      );
 
      originatorEv = null;
    };
 
    this.checkVoicemail = function() {
      // This never happens.
    };
  });