如何使用angularfirestore将2个集合中的数据合并

时间:2018-09-11 07:59:05

标签: angularjs typescript firebase google-cloud-firestore angularfire2

如何从2个集合中加入数据,我想列出所有具有category_key的项目,集合是类别和项目: 我最初在 category.service.ts 中拥有的代码,它现在显示类别详细信息:

import AVFoundation
import UIKit

    enum Vibration {
    case error
    case success
    case warning
    case light
    case medium
    case heavy
    case selection
    case oldSchool

    func vibrate() {

      switch self {
      case .error:
        let generator = UINotificationFeedbackGenerator()
        generator.notificationOccurred(.error)

      case .success:
        let generator = UINotificationFeedbackGenerator()
        generator.notificationOccurred(.success)

      case .warning:
        let generator = UINotificationFeedbackGenerator()
        generator.notificationOccurred(.warning)

      case .light:
        let generator = UIImpactFeedbackGenerator(style: .light)
        generator.impactOccurred()

      case .medium:
        let generator = UIImpactFeedbackGenerator(style: .medium)
        generator.impactOccurred()

      case .heavy:
        let generator = UIImpactFeedbackGenerator(style: .heavy)
        generator.impactOccurred()

      case .selection:
        let generator = UISelectionFeedbackGenerator()
        generator.selectionChanged()

      case .oldSchool:
        AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate))
      }

    }

}

格式:

类别

  1. id:“ xxxxx”
  2. 名称:'name_of_category'

项目

  1. cat_id:“ xxxxx”

  2. 项目:“ name_of_item”

0 个答案:

没有答案