Skip to content

Commit 32c756f

Browse files
committed
fix: change in page onInit for onChanges
1 parent 1b39f75 commit 32c756f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

projects/ngx-notion-cms/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-notion-cms",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"peerDependencies": {
55
"@angular/common": "^18.2.0",
66
"@angular/core": "^18.2.0",

projects/ngx-notion-cms/src/lib/components/notion-page/notion-page.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
Component,
66
inject,
77
input,
8-
OnInit,
9-
signal,
8+
OnChanges,
9+
signal
1010
} from '@angular/core';
1111
import { map, Observable } from 'rxjs';
1212
import { INgxNotionResponse } from '../../services/http-notion.service';
@@ -30,7 +30,7 @@ import { NotionTableOfContentsComponent } from '../table-of-contents/notion-tabl
3030
styleUrl: './notion-page.component.css',
3131
changeDetection: ChangeDetectionStrategy.OnPush,
3232
})
33-
export class NotionPageComponent implements OnInit {
33+
export class NotionPageComponent implements OnChanges {
3434
private ngxNotionService: NgxNotionService = inject(NgxNotionService);
3535

3636
public pageId = input.required<string>();
@@ -39,7 +39,7 @@ export class NotionPageComponent implements OnInit {
3939
public notionBlocksQuery!: INgxNotionResponse<NotionBlock[]>;
4040
private cdr = inject(ChangeDetectorRef);
4141

42-
ngOnInit(): void {
42+
ngOnChanges(): void {
4343
this.notionBlocksQuery = this.ngxNotionService.getPageBlocks(
4444
this.pageId()
4545
);

0 commit comments

Comments
 (0)