(private elementRef: ElementRef)
| 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 { |
nothing calls this directly
no test coverage detected