rxjs审核时间不适用于angular 6

时间:2018-08-14 10:28:38

标签: angular rxjs6

我有这样的代码:

表格:

<form [formGroup]="logoForm" (ngSubmit)="saveLogoInfo(logoForm)">

    <mat-card>

        <mat-card-title>Add information about your creative logo</mat-card-title>

        <mat-form-field>
            <input matInput placeholder="Title" #logoTitle formControlName="logoTitle" required>
        </mat-form-field>

        <mat-form-field>
            <input matInput placeholder="Caption" formControlName="logoCaption" #logoCaption>
        </mat-form-field>    

    </mat-card>

</form>

ts代码:

import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { LogoDesignService } from './logo-design.service';
import { NgForm, FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';
import { Observable } from 'rxjs/Rx';
import { auditTime } from "rxjs/operators";


@Component({
  selector: 'app-logo-design',
  templateUrl: './logo-design.component.html',
  styleUrls: ['./logo-design.component.css']
})
export class LogoDesignComponent implements OnInit {

  logoForm: FormGroup;

  @ViewChild('logoTitle') logoTitle: ElementRef;
  @ViewChild('logoCaption') logoCaption: ElementRef;
  private alive: boolean;

  constructor(private _logoDesignService: LogoDesignService, private fb: FormBuilder) { }

  ngOnInit() {

    this.logoForm = this.fb.group({
      logoTitle: ['', Validators.required],
      logoCaption: '',
    });

    this.logoForm.valueChanges.auditTime(3000).subscribe(value => {
      console.log('value', value);
    })
  }

  progressiveSave(logoTitle) {
    console.log('debouncing 1: ', logoTitle);
  }

  saveLogoInfo(form: NgForm) {
  }

}

包装json:

"rxjs": "6.0.0",
"rxjs-compat": "^6.2.2",

我在页面ERROR TypeError: this.logoForm.valueChanges.auditTime is not a function上遇到错误

0 个答案:

没有答案