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


TypeScript database-deprecated.FirebaseListFactory函數代碼示例

本文整理匯總了TypeScript中@angular/fire/database-deprecated.FirebaseListFactory函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirebaseListFactory函數的具體用法?TypeScript FirebaseListFactory怎麽用?TypeScript FirebaseListFactory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: beforeEach

 beforeEach((done: any) => {
   toKey = (val: any) => val.key;
   val1 = { key: 'key1' };
   val2 = { key: 'key2' };
   val3 = { key: 'key3' };
   app.database().ref().remove(done);
   questions = FirebaseListFactory(app.database().ref(`questions`));
   questionsSnapshotted = FirebaseListFactory(app.database().ref(`questionssnapshot`), { preserveSnapshot: true });
   ref = questions.$ref;
   refSnapshotted = questionsSnapshotted.$ref;
 });
開發者ID:PaulD11,項目名稱:angularfire2,代碼行數:11,代碼來源:firebase_list_factory.spec.ts

示例2: it

 it('should call off on all events when disposed', (done: any) => {
   const questionRef = app.database().ref().child('questions');
   subscription = FirebaseListFactory(questionRef).subscribe(_ => {
     let firebaseSpy = spyOn(questionRef, 'off').and.callThrough();
     expect(firebaseSpy).not.toHaveBeenCalled();
     subscription.unsubscribe();
     expect(firebaseSpy).toHaveBeenCalled();
     done();
   });
 });
開發者ID:PaulD11,項目名稱:angularfire2,代碼行數:10,代碼來源:firebase_list_factory.spec.ts

示例3: FirebaseListFactory

 .run(() => {
   // Creating a new observable so that the current zone is captured.
   subscription = FirebaseListFactory(app.database().ref(`questions`))
     .filter(d => d
       .map((v: any) => v.$value)
       .indexOf('in-the-zone') > -1)
     .subscribe(data => {
       expect(Zone.current.name).toBe('newZone');
       done();
     });
 });
開發者ID:PaulD11,項目名稱:angularfire2,代碼行數:11,代碼來源:firebase_list_factory.spec.ts


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