I'm coming back to an Angular project after a long while away, and I'm updating Angular (and RxJS) to version 6. One of the many errors being thrown relate (I assume) to pipeable operators, which were new in RxJS 6. Here's an example of one:
src/app/member-view/member-view.service.ts(126,13): error TS2339: Property 'monthOne' does not exist on type 'any[]'.
Here's the code that throws it:
let results = this.db.list(`renown/${uid}/${this.years[0]}/${this.months[0]}/total`)
.pipe(switchMap(total => {
let joinedObservables: any[] = []
joinedObservables.push(this.db
.object(`renown/${uid}/${this.years[0]}/${this.months[0]}/total`)
.pipe(tap(value => {
if (value.$value !== null) {
total.monthOne = value.$value
This error did not exist until the operator switchMap was moved to within the .pipe(), which is required as of RxJS 6. Is this a typing issue or a syntax error?
$valueatribute of the result ofthis.db.object(...)is an array. Maybe you want to usevalue.$value[0]... - julianobrasilconsole.log(value.$value)- julianobrasiltotalis not an issue (I find it particularly confusing in the long term). - julianobrasil.pipe(switchMap...)there's no error. Except it doesn't recognizeswitchMapanymore because with RxJS you have to pipe operators now. And the code won't compile, so I can't log in the console. - J. Adam Connor