0
例へのデータのロード後に円形のエラーを返す: コードはこのHTMLによってトリガされる:これは、UIのグリッドを作成
<div google-chart chart = "chartObject" style = "height:600px; width:100%;" agc-on-select="selectHandler(selectedItem)" ng-if="chartvisible"></div>
:
[
{
"challenge": "asdfrew2",
"id": 1,
"startTime": "start time 1",
"successfullyCompleted": false,
"username": "JamieFalter"
},
{
"challenge": "454454y",
"id": 2,
"startTime": "start time 2",
"successfullyCompleted": false,
"username": "Falter"
}
]
次のようになり、エラーを返します:01変数 'ポスト' のような何かがある
$scope.gridOptions = gridService.getGrid([25, 50, 75], 25, ['username','startTime']);
$scope.gridOptions.data = post;
$scope.$apply();
TypeError: Converting circular structure to JSON
at na (angular.js:1121) at angular.js:20566 at Object.fn (angular.js:12411) at k.$digest (angular.js:12540) at k.$apply (angular.js:12805) at Object.<anonymous> (Controller.js:54)//Points to the Scope.Apply at i (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at y (jquery.min.js:4) at XMLHttpRequest.c (jquery.min.js:4)
これまでに見たことがありますか?もしそうなら、それをどうやって解決しましたか?より優れたエラー処理のために
$scope.$apply(function() {
// code here
});
:
なぜ適用が必要ですか?このエラーは、JSONがポイントを作成しているように見えます。つまり、循環参照を生成します。 –
gridoptions8の 'data'フィールドへの変更が気付きました。 –