1
- import { Subject , Subscription } from 'rxjs' ;
2
- import { A , Z , ZERO , NINE } from '@angular/cdk/keycodes' ;
3
- import { debounceTime , filter , map , take , tap } from 'rxjs/operators' ;
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ import { A , NINE , Z , ZERO } from '@angular/cdk/keycodes' ;
10
+ import { Subject , Observable } from 'rxjs' ;
11
+ import { debounceTime , filter , map , tap } from 'rxjs/operators' ;
4
12
5
13
const DEFAULT_TYPEAHEAD_DEBOUNCE_INTERVAL_MS = 200 ;
6
14
@@ -24,7 +32,7 @@ export class Typeahead<T extends TypeaheadItem> {
24
32
private _skipPredicateFn ?: ( item : T ) => boolean | undefined ;
25
33
26
34
private readonly _selectedItem = new Subject < T > ( ) ;
27
- readonly selectedItem = this . _selectedItem . asObservable ( ) ;
35
+ readonly selectedItem : Observable < T > = this . _selectedItem ;
28
36
29
37
constructor ( initialItems : T [ ] , config ?: TypeaheadConfig < T > ) {
30
38
const typeAheadInterval =
@@ -41,7 +49,6 @@ export class Typeahead<T extends TypeaheadItem> {
41
49
initialItems . length &&
42
50
initialItems . some ( item => typeof item . getLabel !== 'function' )
43
51
) {
44
- console . error ( 'failed' , initialItems ) ;
45
52
throw new Error ( 'KeyManager items in typeahead mode must implement the `getLabel` method.' ) ;
46
53
}
47
54
0 commit comments