# injectStore

Signature
`injectStore(): Store`

valdres-angular
Access the current store instance

Injects the current valdres store from the Angular dependency injection system. Useful for imperative operations.

## Usage

```ts
import { Component } from "@angular/core"
import { injectStore } from "valdres-angular"

@Component({
    selector: "app-debug",
    template: `<button (click)="logValue()">Log value</button>`,
})
export class DebugComponent {
    private store = injectStore()

    logValue() {
        console.log("Current:", this.store.get(myAtom))
    }
}
```

## See also

- [provideValdres](https://valdres.dev/angular/provideValdres) — setup valdres in Angular
- [store](https://valdres.dev/valdres/store) — create a store instance
