LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/angularinjectProjection
Functionā—Since v1.0

injectProjection

Copy
injectProjection<
  T
>(
  registry: ChannelRegistry | Signal<ChannelRegistry | null | undefined> |
View source on GitHub
null
|
undefined
,
specFactory
:
(
)
=
>
ProjectionSpec
<
T
>
,
key
:
string
|
Signal
<
string
>
,
initialValue
:
T
)
:
Signal
<
T
>

Parameters

NameTypeDescription
registry*ChannelRegistry | Signal<ChannelRegistry | null | undefined> | null | undefined
specFactory*() => ProjectionSpec<T>
key*string | Signal<string>
initialValue*T

Angular-side primitive that composes ChannelRegistry.acquire with Angular Signals + DestroyRef.

Contract (mirrors the React useProjection hook and the Vue useProjection composable, but adapted to Angular's injection context):

  • Must be called in an injection context (component / directive / service field initializer, or runInInjectionContext(...)).
  • On first read (or when registry / key change) acquires a ref-counted projection from the registry and subscribes to its store. A computed view over the snapshot signal is returned.
  • On destroy (or when registry / key change) the previous acquisition is released. If this was the last consumer of that spec, the registry closes the underlying server subscription.
  • When registry is null/undefined the projection stays at initialValue. This is the happy path for root-served projections (injectMessages, injectToolCalls, injectValues) which delegate to the always-on root snapshot instead of acquiring a new registry projection.

Reactive inputs: registry and key accept either a plain value or a Signal so selector helpers can feed a computed target (e.g. a subagent snapshot tracked on a signal) and rebind automatically.