角材のドキュメントを見て、マットオートコンプリートを利用する際に問題が発生しました。どんな支援も大歓迎です。パイプ使用時の角材誤差
エラーパイプは、観察可能なタイプに
import {Component, OnInit} from '@angular/core';
import {FormControl} from '@angular/forms';
import {Observable} from 'rxjs/Observable';
import {pipe} from "rxjs/util/pipe";
import {startWith} from 'rxjs/operator/startWith';
import {map} from 'rxjs/operator/map';
@Component({
selector: 'autocomplete-filter-example',
templateUrl: './my-template.html'
})
export class AutocompleteFilterExample {
myControl: FormControl = new FormControl();
options = [
'One',
'Two',
'Three'
];
filteredOptions: Observable<string[]>;
ngOnInit() {
this.filteredOptions = this.myControl.valueChanges
.pipe(
startWith(''),
map(val => this.filter(val))
);
}
filter(val: string): string[] {
return this.options.filter(option =>
option.toLowerCase().indexOf(val.toLowerCase()) === 0);
}
}
は、rxjs 5.5.xのローカルバージョンですか? –
私の現在のバージョンは5.4.2ではありません –
これに関するアップデートはありますか? –