Closed klalle closed 6 years ago
Solved it...
changed it to:
this.edit = source.pipe(scan<string, boolean>(prev => !prev, true));
this.view = source.pipe(scan<string, boolean>(prev => !prev, false));
Angular: 7.1.1
rxjs 6.3.3
Thanks for an awesome component!
/Kalle
I am using the beta-version for angular 7, and this works fine, but I get one error message when code compiles. Since RxJs is updated I had to rewrite:
this.edit = source.scan(prev => !prev, true);
to:this.edit = source.pipe(scan(prev => !prev, false));
in file: add-remove-edit.component.ts and imports like:import { BehaviorSubject, Observable, Subject} from 'rxjs'; import { scan, startWith, filter, take} from 'rxjs/operators';
This compiles successfully, and works, but with an error message:
ERROR in src/app/add-remove-edit/add-remove-edit.component.ts(156,29): error TS2345: Argument of type 'MonoTypeOperatorFunction<boolean>' is not assignable to parameter of type 'OperatorFunction<string, boolean>'. Types of parameters 'source' and 'source' are incompatible. Type 'Observable<string>' is not assignable to type 'Observable<boolean>'. Type 'string' is not assignable to type 'boolean'. src/app/add-remove-edit/add-remove-edit.component.ts(157,29): error TS2345: Argument of type 'MonoTypeOperatorFunction<boolean>' is not assignable to parameter of type 'OperatorFunction<string, boolean>'.
Any idéa of how to fix this? /Kalle
app.zip