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

16.67% Statements 1/6
0% Branches 0/2
0% Functions 0/3
16.67% Lines 1/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                          
angular.module('selectDemoOptionsAsync', ['ngMaterial'])
.controller('SelectAsyncController', function($timeout, $scope) {
  $scope.user = null;
  $scope.users = null;
 
  $scope.loadUsers = function() {
 
    // Use timeout to simulate a 650ms request.
    return $timeout(function() {
 
      $scope.users =  $scope.users  || [
        { id: 1, name: 'Scooby Doo' },
        { id: 2, name: 'Shaggy Rodgers' },
        { id: 3, name: 'Fred Jones' },
        { id: 4, name: 'Daphne Blake' },
        { id: 5, name: 'Velma Dinkley' }
      ];
 
    }, 650);
  };
});