- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在标题中收到错误,这是完整的堆栈跟踪,我不确定它是什么,欢迎任何见解!
browser_adapter.js:84 EXCEPTION: Error in ./ParametersFormComponent class ParametersFormComponent - inline template:3:31BrowserDomAdapter.logError @ browser_adapter.js:84BrowserDomAdapter.logGroup @ browser_adapter.js:94ExceptionHandler.call @ exception_handler.js:65next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:84 ORIGINAL EXCEPTION: TypeError: Converting circular structure to JSONBrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:74next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:84 ORIGINAL STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:77next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:84 TypeError: Converting circular structure to JSON
at Object.stringify (native)
at ParametersFormComponent.onSubmit (http://localhost:4200/main.bundle.js:61451:25)
at DebugAppView._View_ParametersFormComponent0._handle_ngSubmit_7_0 (ParametersFormComponent.ngfactory.js:1809:28)
at http://localhost:4200/main.bundle.js:57019:24
at SafeSubscriber.schedulerFn [as _next] (http://localhost:4200/main.bundle.js:11839:54)
at SafeSubscriber.__tryOrUnsub (http://localhost:4200/main.bundle.js:48280:16)
at SafeSubscriber.next (http://localhost:4200/main.bundle.js:48229:22)
at Subscriber._next (http://localhost:4200/main.bundle.js:48179:26)
at Subscriber.next (http://localhost:4200/main.bundle.js:48143:18)
at EventEmitter.Subject._finalNext (http://localhost:4200/main.bundle.js:9733:30)
at EventEmitter.Subject._next (http://localhost:4200/main.bundle.js:9725:18)
at EventEmitter.Subject.next (http://localhost:4200/main.bundle.js:9682:14)BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:78next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:84 ERROR CONTEXT:BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:81next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:84 DebugContext {_view: _View_ParametersFormComponent0, _nodeIndex: 7, _tplRow: 3, _tplCol: 31}BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:82next @ application_ref.js:348schedulerFn @ async.js:89SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:77onError @ ng_zone.js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:86NgZone.runGuarded @ ng_zone.js:240outsideHandler @ dom_events.js:27ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
:4200/polyfills.bundle.js:3327 Uncaught EXCEPTION: Error in ./ParametersFormComponent class ParametersFormComponent - inline template:3:31
ORIGINAL EXCEPTION: TypeError: Converting circular structure to JSON
ORIGINAL STACKTRACE:
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at ParametersFormComponent.onSubmit (http://localhost:4200/main.bundle.js:61451:25)
at DebugAppView._View_ParametersFormComponent0._handle_ngSubmit_7_0 (ParametersFormComponent.ngfactory.js:1809:28)
at http://localhost:4200/main.bundle.js:57019:24
at SafeSubscriber.schedulerFn [as _next] (http://localhost:4200/main.bundle.js:11839:54)
at SafeSubscriber.__tryOrUnsub (http://localhost:4200/main.bundle.js:48280:16)
at SafeSubscriber.next (http://localhost:4200/main.bundle.js:48229:22)
at Subscriber._next (http://localhost:4200/main.bundle.js:48179:26)
at Subscriber.next (http://localhost:4200/main.bundle.js:48143:18)
at EventEmitter.Subject._finalNext (http://localhost:4200/main.bundle.js:9733:30)
at EventEmitter.Subject._next (http://localhost:4200/main.bundle.js:9725:18)
at EventEmitter.Subject.next (http://localhost:4200/main.bundle.js:9682:14)
ERROR CONTEXT:
[object Object]
Navigated to http://localhost:4200/?
组件
import {Component} from '@angular/core';
import { FormGroup, FormControl, REACTIVE_FORM_DIRECTIVES, Validators, AbstractControl, Control } from '@angular/forms';
import { Headers, Http, Response } from '@angular/http';
@Component({
selector: 'parameters-form',
directives: [REACTIVE_FORM_DIRECTIVES],
templateUrl: 'form.template.html'
})
export class ParametersFormComponent {
response: {};
myForm: FormGroup;
systemParameters: AbstractControl;
param: AbstractControl;
liftOperator: AbstractControl;
restrictOperator: AbstractControl;
xInitial: AbstractControl;
system_arr: number[];
param_arr: number[];
restrict_arr: number[];
lift_arr: number[];
xinitial_arr: number[];
constructor(private http: Http) {
this.myForm = new FormGroup({
'realisations' : new FormControl('', Validators.required),
'numConstSteps' : new FormControl('', Validators.required),
'timeHorizon': new FormControl('', Validators.required),
'continuationStep' : new FormControl('', Validators.required),
'continuationStepSign' : new FormControl('', Validators.required),
'numberOfModelParameters' : new FormControl('', Validators.required),
'systemParameters' : new FormControl(''),
'param' : new FormControl(''),
'netLogoFile' : new FormControl('', Validators.required),
'numberOfModelVariables' : new FormControl('', Validators.required),
'restrictOperator' : new FormControl(''),
'liftOperator' : new FormControl(''),
'xInitial' : new FormControl('')
});
this.system_arr = [];
this.param_arr = [];
this.restrict_arr = [];
this.lift_arr = [];
this.xinitial_arr = [];
this.param = this.myForm.controls["param"];
this.systemParameters = this.myForm.controls['systemParameters'];
this.restrictOperator = this.myForm.controls['restrictOperator'];
this.liftOperator = this.myForm.controls['liftOperator'];
this.xInitial = this.myForm.controls['xInitial'];
}
addToArray(event, value: number, target: string): void {
if (event.which === 13) {
switch (target) {
case 'systemParameters':
this.system_arr.push(value);
(<Control>this.systemParameters).updateValue('');
break;
case 'param':
this.param_arr.push(value);
(<Control>this.param).updateValue('');
break;
case 'liftOperator':
this.lift_arr.push(value);
(<Control>this.liftOperator).updateValue('');
break;
case 'restrictOperator':
this.restrict_arr.push(value);
(<Control>this.restrictOperator).updateValue('');
break;
case 'xInitial':
this.xinitial_arr.push(value);
(<Control>this.xInitial).updateValue('');
break;
}
}
}
deleteItem(value: any, target: string): void {
let pos = 0;
switch (target) {
case 'systemParameters':
pos = this.system_arr.indexOf(value);
this.system_arr.splice(pos, 1);
break;
case 'param':
pos = this.param_arr.indexOf(value);
this.param_arr.splice(pos, 1);
break;
case 'liftOperator':
pos = this.lift_arr.indexOf(value);
this.lift_arr.splice(pos, 1);
break;
case 'restrictOperator':
pos = this.restrict_arr.indexOf(value);
this.restrict_arr.splice(pos, 1);
break;
case 'xInitial':
pos = this.xinitial_arr.indexOf(value);
this.xinitial_arr.splice(pos, 1);
break;
}
}
isFullfilled(m: number, n: number) {
if (
m == this.restrict_arr.length
&& m == this.xinitial_arr.length
&& m == this.lift_arr.length
&& n == this.param_arr.length
&& n == this.system_arr.length
) {
if (m != 0 && n != 0 ){
return true;
}
}
return null;
}
onSubmit() {
this.myForm.value.systemParameters = this.system_arr;
this.myForm.value.liftOperator = this.lift_arr;
this.myForm.value.restrictOperator = this.restrict_arr;
this.myForm.value.param = this.param_arr;
this.myForm.value.xInitial = this.xinitial_arr;
let Form = JSON.stringify(this.myForm);
let headers = new Headers();
headers.append('Content-Type', 'application/json');
this.http.post('http://localhost:3000/webhook', Form, { headers: headers })
.map((data: Response) => data.json())
.subscribe(
data => this.response = data,
error => console.log(error)
);
console.log('your submitted value:', this.myForm.value);
}
}
在我将它从 Beta 移植到 RC5 之前工作正常
最佳答案
这个错误似乎是因为我试图对整个 myForm 对象进行字符串化,而我想要的只是对值进行字符串化
正确的语法
let Form = JSON.stringify(this.myForm.value);
关于angular - 类型错误 : Converting circular structure to JSON when trying to POST request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38906080/
这两个句子有什么区别: res = requests.request('POST', url) 和 res = requests.request.post(url) 最佳答案 它们几乎是一样的:htt
我正在使用“请求对话框”来创建 Facebook 请求。为了让用户收到请求,我需要使用图形 API 访问 Request 对象。我已经尝试了大多数看起来合适的权限设置(read_requests 和
urllib.request和http.client都是python标准库。前者相关方法的文档是 here后者,here (我使用的是3.5) 有谁知道为什么标准库中有两种方法看起来做同样的事情,或者
我是 Twisted 的新手,我不明白为什么在运行我的脚本时会出现此错误。\ 基本上,该脚本由 2 个页面组成,第一个页面是一个 HTML 表单,它调用自身执行一个阻塞方法并显示结果。当请求同时发送到
我有一个客户端 JS 文件,其中包含: agent = require('superagent'); request = agent.get(url); 然后我有类似的东西 request.get(u
提前输入功能可以正常工作。但问题是,提前输入功能会在每个数据请求上发出 JSON 请求,而实际上只应针对一个特定请求发生。 我有以下 Controller : #controllers/agencie
我正在使用 Rust 开发一个小型 API,我不确定如何在两个地方访问来自 Iron 的 Request。 Authentication 中间件为 token 读取一次Request,如果路径被允许(
问题起因 今天一位网友向我们反馈,用Chrome打开某些博客文章时,会出现"Bad Request - Request Too Long. HTTP Error 400. The siz
当我从 LinkedIn 向 https://api.linkedin.com/uas/oauth/requestToken 请求请求 token 时,出现以下错误: oauth_problem=si
我只是想使用 okhttp 下载一些字节数据,但在我完成代码之前,我遇到了一个问题,android studio 报告了一个错误,说“Request(okhttp3.Request.Builder)
我正在使用 Windows 10。我想在我的系统上使用 Angular 4。当我运行 node -v 和 npm -v 时,它会显示版本。但是当我执行语句 npm install -g @angula
我正在尝试让一个简单的 Iron 示例起作用: extern crate iron; extern crate router; use iron::prelude::*; use iron::stat
我正在尝试使用嵌套字典“动态”创建一个数据输入表单(目前,我使用具有 3 个值的数组,但将来数组中的元素数量可能会有所不同)。这似乎工作正常,并且表单“正确”渲染了 html 模板(正确 = 我看到了
从 ASP.NET 中的代码隐藏访问表单或查询字符串值时,使用的优缺点是什么,例如: // short way string p = Request["param"]; 代替: // long way
我遇到了一个问题,我想知道更好的解决方法。 有五个 api 请求并行运行,第二个请求依赖于第四个请求的响应,但所有 5 个请求都已在运行。什么是更好的方法? 需要建议。提前致谢。 最佳答案 调度地面工
我收到以下错误:TypeError:序列项 0:预期字节、字节数组或具有缓冲区接口(interface)的对象、找到元组 我检查了Python文档,urllib.request.Request的参数似
当我向函数添加超时参数时,我的代码总是进入异常并打印出“我失败了”。当我删除超时参数时,代码会正常工作,并进入 try 子句。关于超时参数如何在 urllib.request 函数中工作的任何信息?
我使用 cURL 向服务器发送请求这是链接:Server Side script for cURL request我用 file_get_contents('php://input'); 读取发送的数
请大家帮帮我我正在尝试使用 NUTCH 抓取网站,但它给我错误“java.io.IOException: Job failed!” 我正在运行此命令“bin/nutch solrindex http:
在我的 AngularJS 应用程序中,我无法弄清楚如何对 then promise 的执行更改 location.url 进行单元测试。我有一个函数,登录 ,调用服务,身份验证服务 .它返回 pro
我是一名优秀的程序员,十分优秀!