0

我已经升级到 Angular/Rxjs 6,我注意到 Observable 上的“跳过”运算符不再存在。我一直找不到合适的替代品,有人有什么建议吗?谢谢!

4

2 回答 2

2
.skip(1)

变成:

.pipe(skip(1))
于 2018-05-12T04:22:46.057 回答
0

确保你有正确的导入,然后用 .pipe( , , ,) 包装你的 .skip

import { Observable, of, throwError } from 'rxjs';
import { map, filter, scan, skip } from 'rxjs/operators';

  .pipe(
    filter(() => this.registrationForm.valid),
    map((registrationForm: any) => { // Form to-> ViewModel
      this.registrationVm.username = registrationForm.username;
      this.registrationVm.password = registrationForm.password;
      this.registrationVm.passwordConfirm = registrationForm.passwordConfirm;
    })
  )
  .subscribe();
于 2018-06-05T20:22:41.830 回答