src/components/autocomplete/js/autocompleteController.js
function select (index) {
    // force form to update state for validation
    $mdUtil.nextTick(function () {
      getDisplayValue(ctrl.matches[ index ]).then(function (val) {
        var ngModel = elements.$.input.controller('ngModel');
        $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive');
        ngModel.$setViewValue(val);
        ngModel.$render();
      }).finally(function () {
        $scope.selectedItem = ctrl.matches[ index ];
        setLoading(false);
      });
    }, false);
  }
function select (index) {
    // force form to update state for validation
    $mdUtil.nextTick(function () {
      getDisplayValue(ctrl.matches[ index ]).then(function (val) {
        var ngModel = elements.$.input.controller('ngModel');
        $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive');
        ngModel.$setViewValue(val);
        ngModel.$render();
      }).finally(function () {
        $scope.selectedItem = ctrl.matches[ index ];
        setLoading(false);
      });
    }, false);
  }
function select ( index ) { // force form to update state for validation $mdUtil . nextTick ( function ( ) { getDisplayValue ( ctrl . matches [ index ] ) . then ( function ( val ) { var ngModel = elements . $ . input . controller ( 'ngModel' ) ; $mdLiveAnnouncer . announce ( val + ' ' + ctrl . selectedMessage , 'assertive' ) ; ngModel . $setViewValue ( val ) ; ngModel . $render ( ) ; } ) . finally ( function ( ) { $scope . selectedItem = ctrl . matches [ index ] ; setLoading ( false ) ; } ) ; } , false ) ; }
Selects the item at the given index.
@param {number} index to select
Selects the item at the given index .