import { Injectable } from '@angular/core';
import { AccountingTransactionsStoreService } from './accounting-transactions-store.service';
import { GeneralLedgerAccountsStoreService } from './general-ledger-accounts-store.service';
import { distinctUntilChanged, map, combineLatest } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class AccountingReportsStoreService {
constructor(
private accountingTransactionsStore: AccountingTransactionsStoreService,
private generalLedgerAccountsStore: GeneralLedgerAccountsStoreService)
{}
readonly generalLedgerAccountsTransaction$
= combineLatest(
this.accountingTransactionsStore.selectedPeriodAccountingTransactionsFlate$,
this.generalLedgerAccountsStore.selectedOrganizationGeneralLedgerAccountsTree$)
.pipe(distinctUntilChanged())
.pipe(
map(([transactionsFlat, accountsTree]) => {
if (transactionsFlat && accountsTree)
return [];
else return [];
})
)
}
类型'OperatorFunction <未知的属性'管道'不存在,[unknown,AccountingUnactionFlatInterface [],GeneralLedgerAccountInterface []]>'。
答案 0 :(得分:0)
import { distinctUntilChanged, map, combineLatest } from 'rxjs/operators';
实际上不确定,但是我看起来是关于功能定义超载
combineLatest作为操作符和函数存在于彼此之间。但是,不建议使用操作员版本。根据导入,您会得到一个。
从 'rxjs' 导入 combineLatest ,而不从 'rxjs / operators'导入
import { distinctUntilChanged, map } from 'rxjs/operators';
import { combineLatest} from 'rxjs';