當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript BehaviorSubject.asObservable方法代碼示例

本文整理匯總了TypeScript中rxjs.BehaviorSubject.asObservable方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BehaviorSubject.asObservable方法的具體用法?TypeScript BehaviorSubject.asObservable怎麽用?TypeScript BehaviorSubject.asObservable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rxjs.BehaviorSubject的用法示例。


在下文中一共展示了BehaviorSubject.asObservable方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: readOnlyNotes

 get readOnlyNotes(): Observable<Note[]> {
   return this._readOnlyNotes.asObservable();
 }
開發者ID:a-vzhik,項目名稱:white-raven,代碼行數:3,代碼來源:note.service.ts

示例2: editableNotes

 get editableNotes(): Observable<Note[]> {
   return this._editableNotes.asObservable();
 }
開發者ID:a-vzhik,項目名稱:white-raven,代碼行數:3,代碼來源:note.service.ts

示例3: allNotes

 get allNotes(): Observable<Note[]> {
   return this._allNotes.asObservable();
 }
開發者ID:a-vzhik,項目名稱:white-raven,代碼行數:3,代碼來源:note.service.ts

示例4: myNotes

 get myNotes(): Observable<Note[]> {
   return this._myNotes.asObservable();
 }
開發者ID:a-vzhik,項目名稱:white-raven,代碼行數:3,代碼來源:note.service.ts

示例5: asObservable

 asObservable() {
   return this._subject.asObservable();
 }
開發者ID:ianchi,項目名稱:luci-ng,代碼行數:3,代碼來源:dependency.ts

示例6: getObs

function getObs(): Observable<string> {
    setTimeout(() => subject$.next("next " + i), 2000);
    i++;
    return subject$.asObservable();
}
開發者ID:chrigu,項目名稱:rxjs-experiments,代碼行數:5,代碼來源:behaviorSubject.ts

示例7: BehaviorSubject

        ).subscribe((urlService: NewUrlStateNotificationService) => {
            const view = urlService.getStartPath();

            this.outGutterResized = new BehaviorSubject(this.splitRatioService.getSplitRatio(view));
            this.onGutterResized$ = this.outGutterResized.asObservable();
        });
開發者ID:young891221,項目名稱:pinpoint,代碼行數:6,代碼來源:gutter-event.service.ts

示例8: constructor

 constructor() {  //private http: HttpClient
     this.currentUserSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('currentUser')));
     this.currentUser = this.currentUserSubject.asObservable();
 }
開發者ID:dgdavidgreene,項目名稱:AngularProjectBase,代碼行數:4,代碼來源:authentication.service.ts

示例9: getState

	// I get the current state as a stream (will always emit the current state value as
	// the first item in the stream).
	public getState() : Observable<StateType> {

		return( this.stateSubject.asObservable() );

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:7,代碼來源:simple.store.ts

示例10: constructor

 constructor(private authService: AuthService, private router: Router) {
   this.currentUserSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('currentUser')));
   this.currentUser = this.currentUserSubject.asObservable();
 }
開發者ID:arner,項目名稱:saevis,代碼行數:4,代碼來源:authentication.service.ts


注:本文中的rxjs.BehaviorSubject.asObservable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。