我有这样的代码:
表格:
<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
上遇到错误