> For the complete documentation index, see [llms.txt](https://guide-angular.wishtack.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide-angular.wishtack.io/angular/formulaires/reactive-forms/observation-des-changements.md).

# Observation des Changements

La propriété `valueChanges` est l'une des propriétés les plus importantes des "controls". Il s'agit d'un `Observable` permettant d'**adopter une approche réactive en détectant tous les changements apportés aux données du "control"** *(le `FormGroup` regroupant tous les "controls" est lui-même un "control")*.

A titre d'exemple, le code suivant permet de construire un `Observable` contenant la liste des résultats associés à la recherche de l'utilisateur.\
L'opérateur `debounceTime` permet d'attendre 100ms d'inactivité avant de produire une requête.\
Grâce à l'opérateur `switchMap`, chaque requête en cours est annulée avant d'en produire une nouvelle.

```typescript
this.bookList$ = this.bookForm.valueChanges
    .pipe(
        debounceTime(100),
        switchMap(value => this._bookRepository.search({keywords: value.title}))
    );
```

{% hint style="info" %}
Tant que l'`Observable` n'est pas consommé *(via un `subscribe`)*, aucun traitement n'est exécuté.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://guide-angular.wishtack.io/angular/formulaires/reactive-forms/observation-des-changements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
