小编Chr*_*nel的帖子

@ firebase/database:用户回调抛出了异常.TypeError:无法读取未定义的属性"myID"

一旦我将我的应用程序构建到生产到Firebase托管中,我就会遇到一些用户的错误:

@ firebase/database:FIREBASE警告:用户回调抛出了异常.TypeError:无法读取未定义的属性"myID"

截图

在此输入图像描述

在我的代码中,在任何地方都没有变量"myID" .一切都可以很好地用于开发,但是一旦它被构建并在生产中,错误就会出现在某些用户身上.

这是我的packages.json版本:

"dependencies": {
"@angular-devkit/core": "0.0.29",
"@angular-devkit/schematics": "^0.6.0",
"@angular/animations": "^5.2.10",
"@angular/cli": "^1.7.4",
"@angular/common": "^5.2.10",
"@angular/compiler": "^5.2.10",
"@angular/core": "^5.2.10",
"@angular/forms": "^5.2.10",
"@angular/http": "^5.2.10",
"@angular/platform-browser": "^5.2.10",
"@angular/platform-browser-dynamic": "^5.2.10",
"@angular/router": "^5.2.10",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"@schematics/package-update": "^0.6.0",
"ajv": "^6.0.0",
"angular2-recaptcha": "^0.6.0",
"angularfire2": "^5.0.0-rc.7",
"bootstrap": "^4.1.0",
"core-js": "^2.5.5",
"firebase": "^4.13.1",
"firebase-admin": "^5.10.0",
"firebase-functions": "^0.8.2",
"ng2-validation": "^4.2.0",
"rxjs": "^5.5.10",
"zone.js": "^0.8.26"
 },
"devDependencies": {
"@angular/compiler-cli": "^5.2.10",
"@angular/language-service": "^5.2.10",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^6.0.106",
"codelyzer": "^4.3.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0", …
Run Code Online (Sandbox Code Playgroud)

firebase firebase-realtime-database angular angular5

13
推荐指数
1
解决办法
1347
查看次数

如何使用 Blazor WASM 在保存时激活热重载?

我正在构建一个Blazor WASM Web 应用程序,目前我每次对代码进行更改时都需要重新构建该应用程序。

我找不到让所有组件在 Visual Studio 社区保存时自动重新加载/热重新加载的方法。

由于 React、Vue 和 Angular 允许我在保存时看到重新加载......有没有办法让这个功能与 Blazor 一起使用?

我发现的最好的工作是:

  • 无需调试即可运行应用程序。但是在IDE中保存修改后,我必须在浏览器上点击刷新才能看到修改。

blazor

8
推荐指数
1
解决办法
6135
查看次数

如何使用Firebase云功能发送自定义电子邮件

我希望在使用firebase云功能创建用户后使用nodemail和邮戳发送邮件.

我按照本教程:Dave Martin的教程链接

但不断收到此错误:

发送欢迎电子邮件时出错:{ status: 422,message: 'Zero recipients specified',code: 300}

这是我从云功能发送邮件的代码:

//Mail 
const nodemailer = require('nodemailer')
const postmarkTransport = require('nodemailer-postmark-transport')


// Google Cloud environment variable used:
// firebase functions:config:set postmark.key="API-KEY-HERE"
const postmarkKey = functions.config().postmark.key
const mailTransport = nodemailer.createTransport(postmarkTransport({
auth: {
    apiKey: postmarkKey
}
}))
exports.OnUserCreation = functions.auth.user().onCreate((user) => 
{
console.log("user created: " + user.data.uid);
console.log("user email: " + user.data.email);
sendEmail(user);
})

function sendEmail(user) 
{
// Send welcome email to new users
const mailOptions = 
{
    from: …
Run Code Online (Sandbox Code Playgroud)

node.js postmark firebase nodemailer google-cloud-functions

2
推荐指数
1
解决办法
1442
查看次数

Develop分支在gitflow中没有用吗?

每当我在团队中寻找使用git的正确方法时,我们总是会提到git-flow。

我们从一开始就开始将此计划用作圣经。

在此处输入图片说明

时间的流逝,我们最终发现将master保留为带有标记的commit的稳定分支是浪费时间。

为什么要标记稳定的提交,然后按PUSH以掌握已经标记的相同版本。标签存在,您可以随时返回此提交。为什么要麻烦我保留此分支仅包含标签?

这是我们使用的Git-Flow,它的工作原理就像一种魅力。

Master:实际上是我们的开发分支Release:我们创建一个release分支来做最后一个发布测试用例,然后在需要时添加修订。功能:我们从Master分支创建功能,然后将拉取请求发送给master。

实际上,它与gitflow相同,没有包含稳定的分支。

这样做的另一个优点是,MASTER是DEVELOP分支。因此,当新的队友进入该项目时,他可以从克隆项目开始,而他的主人已经与实际开发保持同步。

在图像中:

在此处输入图片说明

我的问题是,如果您只能用相同的结果管理4个分支,为什么还要使用原始的git-flow和5个分支?

git git-workflow git-flow

2
推荐指数
2
解决办法
595
查看次数

ngClass不适用于Angular 5

您好我是用户角5,我想切换为我的soundcloud播放器更改播放< - >暂停图标.

这是我的TypeScript,后跟我的html.

我可以在我的控制台中看到我正确切换了playMode,但字体真棒图标并没有像预期的那样改变.

谢谢您的帮助.

import { Ng2DeviceService } from 'ng2-device-detector';
import { Component, OnInit } from '@angular/core';
import { NgClass } from '@angular/common';
import './soundcloud-script.js';

@Component({
  selector: 'app-sc-player',
  templateUrl: './sc-player.component.html',
  styleUrls: ['./sc-player.component.css']
})
export class ScPlayerComponent{
  playMode: boolean;

  constructor(private deviceService: Ng2DeviceService) 
  {
    this.playMode = true;
  }

toggleIcon(){
  this.playMode = !this.playMode;
  console.log(this.playMode);
}

}
Run Code Online (Sandbox Code Playgroud)
          <span id="play" 
          (click)="toggleIcon()">
          <i [ngClass]="{'fas fa-pause positionPlay': !playMode, 'fas fa-play positionPlay': playMode}"></i>
          </span>
Run Code Online (Sandbox Code Playgroud)

font-awesome angular-template ng-class angular

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