@dotcms/angular
Version:
Official Angular Components library to render a dotCMS page.
40 lines • 1.67 kB
TypeScript
import { Observable } from 'rxjs';
import { DotCMSComposedPageResponse, DotCMSExtendedPageResponse } from '@dotcms/types';
import * as i0 from "@angular/core";
export declare class DotCMSEditablePageService {
#private;
/**
* Listens for changes to an editable page and returns an Observable that emits the updated page data.
* This method initializes the UVE (Universal Visual Editor) and sets up subscriptions to track content changes.
*
* @example
* ```ts
* // Import the service
* import { DotCMSEditablePageService } from '@dotcms/angular';
*
* // Inject the service
* constructor(private editablePageService: DotCMSEditablePageService) {}
*
* // Get the page data from your API call
* const page = await client.page.get('/');
*
* // Listen for changes
* const subscription = this.editablePageService.listen(page).subscribe(updatedPage => {
* if (updatedPage) {
* // Handle updated page data
* console.log('Page updated:', updatedPage);
* }
* });
*
* // When done listening, unsubscribe
* subscription.unsubscribe();
* ```
*
* @param response Optional initial page data
* @returns Observable that emits the updated page data or undefined
*/
listen<T extends DotCMSExtendedPageResponse>(response?: DotCMSComposedPageResponse<T>): Observable<DotCMSComposedPageResponse<T> | undefined>;
static ɵfac: i0.ɵɵFactoryDeclaration<DotCMSEditablePageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DotCMSEditablePageService>;
}
//# sourceMappingURL=dotcms-editable-page.service.d.ts.map