本文整理匯總了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;
});
}
示例2: filter
filter(term: string) {
return this.professors.map(professors =>
professors.filter(professor => {
return professor.firstName.indexOf(term) >= 0 ? true : false;
}
)
);
}
示例3: getProfessorsFrom
getProfessorsFrom(discipline: string) {
let pos = this.convertToPositionArrayCanGive(discipline);
return this.professors.map(professors =>
professors.filter(professor => {
return professor.canGive[pos];
}
)
);
}
示例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;
});
});
}
示例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;
}
示例6: getProfessorsByType
getProfessorsByType(type: number) {
return this.professors.map(professors =>
professors.filter(professor => {
if (professor.canGive !== undefined) {
return professor.canGive[type];
}
}
)
);
}
示例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;
}
}
)
);
}
示例8: filter
filter(term: string) {
return this.classes.map(classes =>
classes.filter(classT =>
{
if (classT.name.indexOf(term) >= 0) {
return true;
} else {
return false;
}
}
)
);
}
示例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;
}
}
}
)
);
}
示例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;
}
}
)
);
}