provideRender()
Registers global default configuration for @ngaf/render via Angular's dependency injection system.
Import
Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
config | RenderConfig | Configuration object with default registry, store, functions, and handlers |
Returns
EnvironmentProviders -- suitable for use in ApplicationConfig.providers or bootstrapApplication().
RenderConfig
| Property | Type | Description |
|---|---|---|
registry | AngularRegistry | Default component registry for all <render-spec> instances |
store | StateStore | Default state store for all <render-spec> instances |
functions | Record<string, ComputedFunction> | Default computed functions for $fn prop expressions |
handlers | Record<string, Handler> | Default event handlers for action dispatch |
All properties are optional. Only provide the defaults you need.
RENDER_CONFIG Token
The configuration is stored in the RENDER_CONFIG injection token:
You can inject it directly if needed:
Usage
Basic Setup
With Store and Handlers
Registry Only
If you only need a global registry and want to provide stores per-instance:
Resolution Priority
RenderSpecComponent resolves each configuration value using this priority:
| Priority | Source | Description |
|---|---|---|
| 1 (highest) | Component input | [registry], [store], [functions], [handlers] on <render-spec> |
| 2 | RENDER_CONFIG | Global defaults from provideRender() |
| 3 (lowest) | Internal fallback | Empty registry, internal signalStateStore() from spec.state |
This means inputs always win over global config:
Global vs Component-Level Config
Use provideRender() when you want shared defaults across your entire application:
This is ideal when you have a single component library that all specs should use.
Optional Provider
provideRender() is not required. If you skip it, RenderSpecComponent requires you to pass registry and store as inputs (or relies on the internal store fallback).
Related
- RenderSpecComponent API -- how the component uses
RENDER_CONFIG - defineAngularRegistry() -- creating registries to pass to config
- signalStateStore() -- creating stores to pass to config
- Installation -- initial setup with
provideRender()