all files / app/main/components/material-docs/demo-partials/select/demoSelectHeader/ script.js

14.29% Statements 1/7
100% Branches 0/0
0% Functions 0/3
14.29% Lines 1/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                            
angular
    .module('selectDemoSelectHeader', ['ngMaterial'])
    .controller('SelectHeaderController', function($scope, $element) {
      $scope.vegetables = ['Corn' ,'Onions' ,'Kale' ,'Arugula' ,'Peas', 'Zucchini'];
      $scope.searchTerm;
      $scope.clearSearchTerm = function() {
        $scope.searchTerm = '';
      };
      // The md-select directive eats keydown events for some quick select
      // logic. Since we have a search input here, we don't need that logic.
      $element.find('input').on('keydown', function(ev) {
          ev.stopPropagation();
      });
    });