Firebase提供商
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
@Injectable() export class FirebaseProvider {
constructor(public afd: AngularFireDatabase) { }
getFoodItems() {
return this.afd.list("/foodItems");
}
addFood(foodName) {
this.afd.list("/foodItems").push(foodName);
}
removeFood(id) {
this.afd.list("/foodItems").remove(id);
}
}
Run Code Online (Sandbox Code Playgroud)
我在这里使用Firebase提供程序(预定义方法)
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { StepperPage } from '../stepper/stepper';
import { AboutUsPage } from '../about-us/about-us';
import { FirebaseProvider } from '../../providers/firebase/firebase';
import { FirebaseListObservable } from …Run Code Online (Sandbox Code Playgroud) 在我的项目中,我遇到了一个严重问题:我收集了所有Employees的集合.有些人Employee有相同的LName:
public class Employee
{
public int ID { get; set; }
public string FName { get; set; }
public string MName { get; set; }
public string LName { get; set; }
public DateTime DOB { get; set; }
public char Gender { get; set; }
}
public class MyClass
{
public List<Employee> GetAll()
{
List<Employee> empList = new List<Employee>();
empList.Add(new Employee()
{
ID = 1,
FName = "John",
MName = "",
LName …Run Code Online (Sandbox Code Playgroud) GetEnumerator()在linq中有什么用?
任何人都可以向我解释它是如何工作的基本例子.
提前致谢.
angular ×2
linq ×2
angular-cli ×1
angular5 ×1
asp.net ×1
firebase ×1
ionic3 ×1
node.js ×1
npm-install ×1
typescript ×1