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


TypeScript FirebaseListObservable.map方法代碼示例

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


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

示例1: constructor

  constructor(plannedExoensesService: PlannedExpensesService, exoensesService: ExpensesService) {
    this.plannedExpenses = plannedExoensesService.get();
    this.expenses = exoensesService.get();

    this.lineChart = new LineChart();
    // this.lineChart.addDataSet();

    this.data = this.expenses.map((next) => {

      var months: any[] = [];
      var totalExpenses: number[] = [];

      Observable.from<IExpenses>(next).groupBy((k) => {
        return new Date(k.at).getMonth() + 1;
      }).map((a) => {
        months.push(a.key);
        var sum = 0;
        a.subscribe((s) => {
          sum += s.amount;
        }, () => { }, () => {
          totalExpenses.push(sum);
        });
      }).subscribe();

      var chartData: ChartData = new ChartData(totalExpenses, months.sort());
      return chartData;
    });
  }
開發者ID:MahmoudHboubati,項目名稱:Angular2-MyAnimationApp,代碼行數:28,代碼來源:expensesVSplanned.component.ts

示例2: filter

  filter(term: string) {
   return this.professors.map(professors =>
      professors.filter(professor => {
         return professor.firstName.indexOf(term) >= 0 ? true : false;
       }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:8,代碼來源:professors.service.ts

示例3: getProfessorsFrom

 getProfessorsFrom(discipline: string) {
   let pos = this.convertToPositionArrayCanGive(discipline);
   return this.professors.map(professors =>
      professors.filter(professor => {
           return professor.canGive[pos];
         }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:9,代碼來源:professors.service.ts

示例4: getAll

 getAll(uid?: string, search?: string) {
     return this.spices.map((spices) => {
       return spices
         .filter(item => this.filter(item, uid, search))
         .sort(function (a, b) {
             return b.timestamp - a.timestamp;
         });  
     });            
 }
開發者ID:mkavcar,項目名稱:AllSpiceNg2_nr,代碼行數:9,代碼來源:spice.service.ts

示例5: setup

 setup(endpoint : string, query?) : Observable<T[]> {
     this.endpoint = endpoint;
     this.firebaseList = this.af.database.list(endpoint, query);
     this.list = this.firebaseList.map(rawTSet => 
         rawTSet.map( rawTData => 
             rawTData
         )
     );
     return this.list;
 }
開發者ID:edicon,項目名稱:ames,代碼行數:10,代碼來源:firebase.service.ts

示例6: getProfessorsByType

 getProfessorsByType(type: number) {
   return this.professors.map(professors =>
      professors.filter(professor => {
         if (professor.canGive !== undefined) {
           return professor.canGive[type];
         }
       }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:10,代碼來源:professors.service.ts

示例7: filter

 filter(term: string) {
   return this.students.map(students =>
      students.filter(student => {
         if (student.firstName.indexOf(term) >= 0 || student.lastName.indexOf(term) >= 0) {
           return true;
         } else {
           return false;
         }
       }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:12,代碼來源:students.service.ts

示例8: filter

 filter(term: string) {
   return this.classes.map(classes =>
      classes.filter(classT =>
       {
         if (classT.name.indexOf(term) >= 0) {
           return true;
         } else {
           return false;
         }
       }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:13,代碼來源:classes.service.ts

示例9: getStudentsWithoutThis

 getStudentsWithoutThis(type: string, keyClass: string) {
   return this.students.map(students =>
      students.filter(student => {
        if (type === 'cc') {
          return true;
        } else {
          if (student.classes[type] === keyClass || student.classes[type] === '') {
            return true;
          } else {
            return false;
          }
        }
       }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:16,代碼來源:students.service.ts

示例10: getStudentsFrom

 getStudentsFrom(discipline: string) {
   return this.students.map(students =>
      students.filter(student => {
        if (discipline === 'cc') {
          if (student.classes !== undefined && student.classes.cc !== undefined) {
            return true;
          } else {
            return false;
          }
        }
        if (student.classes[discipline] !== '') {
          return true;
        } else {
          return false;
        }
      }
     )
   );
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:19,代碼來源:students.service.ts


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