当我通过NavigationExtras将Angular Firestore集合的对象作为参数传递时,会发出此错误。 Angular的版本是7.2
this.reviewCollRef = this.contentProv.getCollectionRef(`tour-contents/${this.docId}/reviews`);
let navigationExtras: NavigationExtras = {
state: {coll: this.reviewCollRef, review: reviewContent}
};
this.router.navigateByUrl('/review-content', navigationExtras);
ERROR错误:未捕获(承诺):DataCloneError:无法在“历史记录”上执行“ pushState”:function(){return tslib_1 .__ awaiter(_this,void 0,void 0,function(){ return tslib_1 .__ g ......}无法克隆。 错误:无法在“历史记录”上执行“ pushState”:function(){return tslib_1 .__ awaiter(_this,void 0,void 0,function(){ return tslib_1 .__ g ......}无法克隆。 在BrowserPlatformLocation.push ../ node_modules/@angular/platform-browser/fesm5/platform-browser.js.BrowserPlatformLocation.pushState(platform-browser.js:605)中 在PathLocationStrategy.push ../ node_modules/@angular/common/fesm5/common.js.PathLocationStrategy.pushState(common.js:475) 在Location.push ../ node_modules/@angular/common/fesm5/common.js.Location.go(common.js:226) 在Router.push ../ node_modules/@angular/router/fesm5/router.js.Router.setBrowserUrl(router.js:4355) 在TapSubscriber._tapNext(router.js:3973) 在TapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / operators / tap.js.TapSubscriber._next(tap.js:45) 在TapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber.next(Subscriber.js:53) 在MapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / operators / map.js.MapSubscriber._next(map.js:41) 在MapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber.next(Subscriber.js:53) 在SwitchMapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / operators / switchMap.js.SwitchMapSubscriber.notifyNext(switchMap.js:72) 在resolvePromise(zone.js:831) 在resolvePromise(zone.js:788) 在zone.js:892 在ZoneDelegate.push ../ node_modules / zone.js / dist / zone.js.ZoneDelegate.invokeTask(zone.js:423) 在Object.onInvokeTask(core.js:17290) 在ZoneDelegate.push ../ node_modules / zone.js / dist / zone.js.ZoneDelegate.invokeTask(zone.js:422) 在Zone.push ../ node_modules / zone.js / dist / zone.js.Zone.runTask(zone.js:195) 在排水微任务队列(zone.js:601) 在ZoneTask.push ../ node_modules / zone.js / dist / zone.js.ZoneTask.invokeTask上[作为调用](zone.js:502) 在invokeTask(zone.js:1744)