0
誰能給我解釋一下什麼立場:打字稿角2 NG-書語法
Subject<User> = new BehaviorSubject<User>(null);
在
export class UserService {
// `currentUser` contains the current user
currentUser: Subject<User> = new BehaviorSubject<User>(null);
public setCurrentUser(newUser: User): void {
this.currentUser.next(newUser);
}
}
請:)
我不明白,TS類型的使用在這種情況下,