Angular entry point for the v2-native stream runtime.
Call from a component, directive, or service field initializer to attach an StreamApi bound to the current DestroyRef:
@Component({ template: `<div>{{ stream.messages() | json }}</div>` })
export class Chat {
readonly stream = injectStream({
assistantId: "agent",
apiUrl: "http://localhost:2024",
});
}
When called with no arguments, looks up a shared StreamApi
previously registered via provideStream. Throws if no
ancestor provider exists.
Must always run inside an Angular injection context.