MCPcopy Create free account
hub / github.com/angular/examples / constructor

Method constructor

dynamic-sdui-app/src/app/chat/chat.component.ts:178–187  ·  view source on GitHub ↗
(private elementRef: ElementRef)

Source from the content-addressed store, hash-verified

176 }
177
178 constructor(private elementRef: ElementRef) {
179 effect(() => {
180 // This effect runs when the conversation history changes.
181 this.conversationHistory();
182
183 // We use a setTimeout to schedule the scroll operation after Angular
184 // has finished updating the DOM with the new message.
185 setTimeout(() => this.scrollToBottom(), 0);
186 });
187 }
188
189 private scrollToBottom(): void {
190 try {

Callers

nothing calls this directly

Calls 1

scrollToBottomMethod · 0.95

Tested by

no test coverage detected