我有一个带有日期字段(开始日期)的屏幕,用户可以在其中输入任何日期
<label class="item item-input">
<span class="input-label">Start Date</span>
<input type="date" ng-model="currentItem.OpenDate">
</label>
Run Code Online (Sandbox Code Playgroud)
我将以下内容添加到"保存"按钮的单击事件中
console.log("Normal date " + $scope.currentItem.OpenDate);
Run Code Online (Sandbox Code Playgroud)
控制台显示以下日期
Normal date Fri May 01 2015 00:00:00 GMT-0400 (Eastern Daylight Time)
Run Code Online (Sandbox Code Playgroud)
这是推送活动
$scope.data.accounts.push({ 'AccountName': $scope.currentItem.AccountName, 'StartBalance': $scope.currentItem.StartBalance, 'OpenDate': $scope.currentItem.OpenDate, 'AccountType': $scope.currentItem.AccountType });
Run Code Online (Sandbox Code Playgroud)
但是,日期$scope.currentItem.OpenDate未保存到Firebase,其余数据正在正常保存.我错过了什么?
我收到以下错误。我的问题不在于实际的错误,而在于它说错误是Uncaught。如果您查看我的auth.service.ts文件sign-in.component.ts,我会发现错误。
我的问题是,为什么在控制台中出现错误:未捕获(承诺)错误?我缺少什么?
我在用着
"@angular/fire": "^7.0.4"
"firebase": "^9.0.2"
"rxjs": "6.6.7"
auth.service.ts
/**
* Sign in
*
* @param credentials
*/
signIn(credentials: { email: string; password: string }): Promise<any>
{
return this.auth.signInWithEmailAndPassword(credentials.email, credentials.password)
.then((userCredential) => {
// Signed in
const user = userCredential.user;
//console.log(user);
// Store the access token in the local storage
userCredential.user.getIdToken().then(token => {
this.accessToken = token;
//console.log(token);
})
// Set the authenticated flag to true
this._authenticated = true;
// …Run Code Online (Sandbox Code Playgroud) javascript firebase angularfire firebase-authentication angular
从下面的打击帖
多路径更新听起来很棒.对于多路径删除,这是否有效?
使用案例:我添加了一个新帖子,它被许多粉丝粉丝.我决定稍后删除该帖子.删除是否有效?你有一个例子吗?
将我的项目升级到 Angular 13 后,当我运行ng serve. 我还包括下面的package.json和webpack.config.js文件。
我已经尝试删除该node_modules文件夹并运行npm install但无济于事。
包.JSON
{
"name": "acentus",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^13.2.4",
"@angular/cdk": "^13.2.4",
"@angular/common": "^13.2.4",
"@angular/compiler": "^13.2.4",
"@angular/core": "^13.2.4",
"@angular/fire": "^7.2.1",
"@angular/forms": "^13.2.4",
"@angular/material": "^13.2.4",
"@angular/platform-browser": "^13.2.4",
"@angular/platform-browser-dynamic": "^13.2.4",
"@angular/router": "^13.2.4",
"@iconify/icons-ic": "^1.0.11",
"@ngneat/tailwind": "^7.0.3",
"@ngrx-utils/store": "^0.13.1",
"@ngrx/effects": "^11.0.1",
"@ngrx/router-store": "^11.0.1", …Run Code Online (Sandbox Code Playgroud)