# Change Detection

The table implements `OnPush` change detection which means the dirty checking checks for immutable data types. That means if you do object mutations like:

```javascript
this.rows[i]['gender'] = 'Female';
```

The table will not detect a change! Instead if you do a change like this, you need to do:

```javascript
this.rows[i]['gender'] = 'Female';
this.rows = [...this.rows];
```

This will cause the table to detect the change and update. Some might have concerns that this is a pricey operation, however, it is MUCH cheaper than running `ngDoCheck` and constantly diffing the array.

For more information, I recommend this article [Angular Change Detection Explained](https://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.html).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://siemens-com.gitbook.io/ngx-datatable/readme/cd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
