Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

formControl Server Side rendering

    this.poNoControl.valueChanges.subscribe(data => {
      debugger;
      var strLength = new String(data);
      if (strLength.length >= 3) {

        this.poNoControl.valueChanges
          .pipe(
            startWith(''),
            debounceTime(200),
            distinctUntilChanged(),
            tap((value) => {
              debugger;
              this.poNoLookupData = [];
            }),
            switchMap(value => this._service.GetPOLookupList(this.poNoControl.value)
              .pipe(
                finalize(() => {

                }),
              )
            )
          )
          .subscribe(data => {
            debugger;
            this.poNoLookupData = data["responseData"];
            this.options = this.poNoLookupData
            if (this.options !== undefined) {
              this.options.filter(x => x.poNumber.toLowerCase().includes(this.poNoControl.value));
              this.options.slice(0, 40);
            }
            this.poNofilteredOptions = this.options;
          });
      }

    })
Source by angular.io #
 
PREVIOUS NEXT
Tagged: #formControl #Server #Side #rendering
ADD COMMENT
Topic
Name
2+3 =