all files / app/main/components/material-docs/demo-partials/list/demoListControls/ script.js

7.14% Statements 1/14
100% Branches 0/0
0% Functions 0/6
7.14% Lines 1/14
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87                                                                                                                                                                            
angular.module('listDemo2', ['ngMaterial'])
.config(function($mdIconProvider) {
  $mdIconProvider
    .iconSet('social', 'assets/angular-material-assets/img/icons/sets/social-icons.svg', 24)
    .iconSet('device', 'assets/angular-material-assets/img/icons/sets/device-icons.svg', 24)
    .iconSet('communication', 'assets/angular-material-assets/img/icons/sets/communication-icons.svg', 24)
    .defaultIconSet('assets/angular-material-assets/img/icons/sets/core-icons.svg', 24);
})
.controller('ListCtrl', function($scope, $mdDialog) {
  $scope.toppings = [
    { name: 'Pepperoni', wanted: true },
    { name: 'Sausage', wanted: false },
    { name: 'Black Olives', wanted: true },
    { name: 'Green Peppers', wanted: false }
  ];
 
  $scope.settings = [
    { name: 'Wi-Fi', extraScreen: 'Wi-fi menu', icon: 'device:network-wifi', enabled: true },
    { name: 'Bluetooth', extraScreen: 'Bluetooth menu', icon: 'device:bluetooth', enabled: false },
  ];
 
  $scope.messages = [
    {id: 1, title: "Message A", selected: false},
    {id: 2, title: "Message B", selected: true},
    {id: 3, title: "Message C", selected: true},
  ];
 
  $scope.people = [
    { name: 'Janet Perkins', img: 'assets/angular-material-assets/img/100-0.jpeg', newMessage: true },
    { name: 'Mary Johnson', img: 'assets/angular-material-assets/img/100-1.jpeg', newMessage: false },
    { name: 'Peter Carlsson', img: 'assets/angular-material-assets/img/100-2.jpeg', newMessage: false }
  ];
 
  $scope.goToPerson = function(person, event) {
    $mdDialog.show(
      $mdDialog.alert()
        .title('Navigating')
        .textContent('Inspect ' + person)
        .ariaLabel('Person inspect demo')
        .clickOutsideToClose(true)
        .parent(angular.element(document.body))
        .ok('Neat!')
        .targetEvent(event)
    );
  };
 
  $scope.navigateTo = function(to, event) {
    $mdDialog.show(
      $mdDialog.alert()
        .title('Navigating')
        .textContent('Imagine being taken to ' + to)
        .ariaLabel('Navigation demo')
        .ok('Neat!')
        .targetEvent(event)
          .clickOutsideToClose(true)
          .parent(angular.element(document.body))
    );
  };
 
  $scope.doPrimaryAction = function(event) {
    $mdDialog.show(
      $mdDialog.alert()
        .title('Primary Action')
        .textContent('Primary actions can be used for one click actions')
        .ariaLabel('Primary click demo')
        .ok('Awesome!')
        .targetEvent(event)
          .clickOutsideToClose(true)
          .parent(angular.element(document.body))
    );
  };
 
  $scope.doSecondaryAction = function(event) {
    $mdDialog.show(
      $mdDialog.alert()
        .title('Secondary Action')
        .textContent('Secondary actions can be used for one click actions')
        .ariaLabel('Secondary click demo')
        .ok('Neat!')
        .targetEvent(event)
          .clickOutsideToClose(true)
          .parent(angular.element(document.body))
    );
  };
 
});