provideValdres
Signature
provideValdres(options?: ValdresOptions): EnvironmentProvidersvaldres-angular Provide a store to your Angular app
Registers a valdres store in Angular's dependency injection system, making it available to all components via the inject* functions.
Usage
import { bootstrapApplication } from "@angular/platform-browser"
import { provideValdres } from "valdres-angular"
import { AppComponent } from "./app.component"
bootstrapApplication(AppComponent, {
providers: [provideValdres()],
})
With a custom store
import { store } from "valdres"
import { provideValdres } from "valdres-angular"
const myStore = store()
bootstrapApplication(AppComponent, {
providers: [provideValdres({ store: myStore })],
})
See also
- injectStore — access the store in components
- store — create a store instance