小编Ham*_*rty的帖子

Angular 9 Keyvalues 管道不是为生产而构建的

我创建的应用程序在开发服务器 ng serve 上运行良好,但是当我尝试为生产构建时,它因此错误而失败

ERROR in src/app/leaderboard/leaderboard.component.html(9,17): Argument of type 'object' is not assignable to parameter of type 'Map<unknown, unknown>'
Run Code Online (Sandbox Code Playgroud)

这是我的排行榜.component.ts

import { Component, OnInit } from '@angular/core';
import * as firebase from 'firebase/app';
import 'firebase/firestore';


@Component({
  selector: 'app-leaderboard',
  templateUrl: './leaderboard.component.html',
  styleUrls: ['./leaderboard.component.css']
})

export class LeaderboardComponent implements OnInit {

  constructor() { }
  db = firebase.firestore();
  cities:object;
  suburbs:object;
  unsorted() { }
  async getCities() {
    await this.db.collection("Cities").orderBy('count', "desc").get()
    .then((querySnapshot) => {
        querySnapshot.forEach((doc) => {
            //console.log(doc.id, ": ", doc.data().count);
            this.cities[doc.id] = doc.data().count …
Run Code Online (Sandbox Code Playgroud)

html typescript angular-pipe angular

10
推荐指数
1
解决办法
1270
查看次数

标签 统计

angular ×1

angular-pipe ×1

html ×1

typescript ×1