Blick auf die Dokumente für Angular Material und lief ein Problem bei der Verwendung der Matte-Autocomplete. Jede Hilfe würde sehr geschätzt werden.Angular Material Errror bei Verwendung von Rohr
Fehler Rohr existiert nicht auf Art beobachtbaren
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);
}
}
ist Ihre lokale Version von rxjs 5.5.x? –
Nein meine aktuelle Version ist 5.4.2 –
Irgendwelche Updates zu diesem Thema? –