Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Ngx索引数据库-数据未保存在Microsoft edge browser中,引发数据错误_Angular_Microsoft Edge - Fatal编程技术网

Angular Ngx索引数据库-数据未保存在Microsoft edge browser中,引发数据错误

Angular Ngx索引数据库-数据未保存在Microsoft edge browser中,引发数据错误,angular,microsoft-edge,Angular,Microsoft Edge,我正在使用Ngx索引db库进行Angular 8项目。当我试图将数据保存到Microsoft Edge browser时,IndexDB抛出数据错误。 在Chrome和Firefox中,它运行良好 App.module.ts import { NgxIndexedDBModule, DBConfig } from 'ngx-indexed-db'; // Ahead of time compiles requires an exported function for factories e

我正在使用Ngx索引db库进行Angular 8项目。当我试图将数据保存到Microsoft Edge browser时,IndexDB抛出数据错误。 在Chrome和Firefox中,它运行良好

App.module.ts

import { NgxIndexedDBModule, DBConfig } from 'ngx-indexed-db';

  // Ahead of time compiles requires an exported function for factories
export function migrationFactory() {
    // The animal table was added with version 2 but none of the existing tables or data needed
    // to be modified so a migrator for that version is not included.
    return {
      1: (db, transaction) => {
        const store = transaction.objectStore('edit-plan');
        // store.createIndex('planId', 'planId', { unique: true });
      },
      3: (db, transaction) => {
        const store = transaction.objectStore('undo-edit-plan');
        // store.createIndex('country', 'country', { unique: false });
      },
      5: (db, transaction) => {
        const store = transaction.objectStore('plan-header');
        // store.createIndex('country', 'country', { unique: false });
      },
    };
  }

const dbConfig: DBConfig = {
    name: 'MyDb',
    version: 9,
    objectStoresMeta: [{
        store: 'edit-plan',
        storeConfig: { keyPath: 'id', autoIncrement: true },
        storeSchema: []
    },
    {
      store: 'undo-edit-plan',
      storeConfig: { keyPath: 'id', autoIncrement: true },
      storeSchema: []
    }, {
      store: 'plan-header',
      storeConfig: { keyPath: 'id', autoIncrement: true },
      storeSchema: []
    }],
    migrationFactory
};
服务文件

import { NgxIndexedDBService } from 'ngx-indexed-db';
export class IndexedDBService {

  constructor(private dbService: NgxIndexedDBService) {}

  save(obj, curstore) {

    this.dbService.add(curstore, obj).then(() => {
        console.log('data saved successfully');
    },error => { console.log(error); }
    );
  }
}
这是你的电话号码
.

目前,我不确定为什么它在保存数据时出错。我将尝试与其他高级工程师讨论这个问题,并尝试了解他们对这个问题的看法。如果我能得到任何有用的信息,我会尽力提供给你。感谢您的理解。这是下面链接中的一个简单示例,我将尝试查看它是否在Edge“提供给操作的数据错误数据不满足要求”中工作,这意味着提供的数据不充分。根据错误堆栈,它在polyfills.js文件中失败。你能提供这个js文件吗。您也可以尝试使用与chrome具有相同核心的新Edge,您可以从microsoft.com/en-us/edgeAt-present下载,我不知道为什么它在保存数据时出现错误。我将尝试与其他高级工程师讨论这个问题,并尝试了解他们对这个问题的看法。如果我能得到任何有用的信息,我会尽力提供给你。感谢您的理解。这是下面链接中的一个简单示例,我将尝试查看它是否在Edge“提供给操作的数据错误数据不满足要求”中工作,这意味着提供的数据不充分。根据错误堆栈,它在polyfills.js文件中失败。你能提供这个js文件吗。您也可以尝试使用与chrome具有相同核心的新Edge,您可以从microsoft.com/en-us/Edge下载