-1
我有一個變量的線程:通信的兩個主題之間
threads: Subject<{[key: string]: Thread }> = new BehaviorSubject({});
我想添加這個線程變量,以我的新threadTest變量:
threadTest : Subject<Array<Thread>> = new Subject();
是否有可能,如:
this.threadTest = this.threads;
感謝您的幫助......
不是。因爲'threads'的類型不是'threadTest'。如果兩者都來自同一類型,那麼它就會起作用。 –
'this.threadTest.next(this.threads.getValue());'@ D.Simon這是行不通的? –
@marouanekadiri 它把這個錯誤:屬性「的getValue」不上類型「主題存在<{[鍵:字符串]:螺紋; }>」 – Floriane