0

如果我们提供一些有效数据,则具有预输入功能并且工作正常,但如果我们提供无效数据,则需要显示为“无数据”。如果我们给出有效的数据,就必须显示有效的结果。您能否建议我错误验证方案,

  accountObservable: Observable<any>;
     asyncAccountValue: string;
       this.accountObservable= new Observable((observer) => {
          observer.next(this.asyncAccountValue);
        }).mergeMap((token: string) =>{
          const test1 = (document.getElementById('idTest') as HTMLInputElement).value;
           return this.http.get('/testAPI/getTestAPIRecords',{params: {param1: param1}});
        });

HTML:

<div class="col-sm-1">
    <input
      id="idsubAccountItemObservable"
      [(ngModel)]="asyncAccountValue"
      [ngModelOptions]="{ standalone: true }"
      [typeahead]="accountObservable"
      (typeaheadLoading)="changeTypeaheadLoading($event)"
      (typeaheadOnSelect)="typeaheadOnSelect($event)"
      class="form-control searchInput"
      required
    />
  </div>
4

0 回答 0