highcharts / highcharts/highcharts-angular

[options] in <highcharts-angular> is not immutable

Open
#174 13 comments 14 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
444
Forks
121
PR merge metrics
No merged PRs in 30d

Description

When passing options into `` via the `async` pipe, it mutates the options object.

```html

```

`chartOptions$` is an observable which takes chartOptions from `ngrx` store, but whenever I change data in the store, it mutates the **PREVIOUS** value stored in the store.

I fixed this by deep cloning the chartOptions before it gets passed into `highcharts-cangular`:

```ts
JSON.parse(JSON.stringify());
```

But can we have an official fix?

Here is the StackBlitz to re-produce the problem:

https://stackblitz.com/edit/angular-soounx

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.