API reference for the centralized message bubble view configuration service in CometChat Angular UIKit
MessageBubbleConfigService is the centralized Angular service for configuring how message bubbles are rendered across the CometChat Angular UIKit. It lets you customize individual sections of any message bubble — globally or per message type — without touching component templates.The service is providedIn: 'root' (singleton by default). All cometchat-message-list instances share the same configuration unless you scope the service.
// Apply a custom status info view to every message typethis.bubbleConfig.setGlobalView('statusInfoView', this.customStatusInfo);// Clear a global viewthis.bubbleConfig.setGlobalView('footerView', null);
By default, MessageBubbleConfigService is a root-level singleton — all message lists share the same configuration. To give a specific component subtree its own independent configuration (e.g., a thread panel with different bubble styles), provide the service at the wrapper component level:
import { Component, inject } from '@angular/core';import { CometChatMessageListComponent, MessageBubbleConfigService } from '@cometchat/chat-uikit-angular';@Component({ selector: 'app-thread-panel', standalone: true, imports: [CometChatMessageListComponent], providers: [MessageBubbleConfigService], // Creates a new instance for this subtree template: `<cometchat-message-list [user]="user" [parentMessageId]="parentMessageId"></cometchat-message-list>`})export class ThreadPanelComponent { // Injects the LOCAL instance, not the root singleton private bubbleConfig = inject(MessageBubbleConfigService); ngAfterViewInit(): void { this.bubbleConfig.setBubbleView('text_message', { contentView: this.threadTextTemplate, }); }}
The main chat panel continues to use the root singleton, unaffected by the thread panel’s configuration.
Each cometchat-message-list provides its own MessageListService internally. The scoping technique above applies only to customization services like MessageBubbleConfigService and FormatterConfigService.