diff --git a/src/app/layout/layout-toolbar.component.ts b/src/app/layout/layout-toolbar.component.ts
index cd25ec790e..0ba3e474ae 100644
--- a/src/app/layout/layout-toolbar.component.ts
+++ b/src/app/layout/layout-toolbar.component.ts
@@ -2,9 +2,9 @@ import {
ChangeDetectionStrategy,
Component,
EventEmitter,
- Input,
Output,
inject,
+ input
} from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@@ -43,9 +43,9 @@ import { WebsiteTheme } from './website-theme';
mat-icon-button
(click)="toggleMenu()"
>
- @if (menuOpen) {
+ @if (menuOpen()) {
menu_open
- } @if (!(menuOpen)) {
+ } @if (!(menuOpen())) {
menu
}
@@ -70,7 +70,7 @@ import { WebsiteTheme } from './website-theme';
class="mr-2"
(click)="toggleTheme()"
>
- @if (theme === 'light') {
+ @if (theme() === 'light') {
light_mode
} @else {
dark_mode
@@ -120,10 +120,10 @@ import { WebsiteTheme } from './website-theme';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class LayoutToolbarComponent {
- @Input() menuOpen: boolean = true;
+ readonly menuOpen = input(true);
@Output() menuOpenChange = new EventEmitter();
- @Input() theme: WebsiteTheme = 'dark';
+ readonly theme = input('dark');
@Output() themeChange = new EventEmitter();
@Output() searchKeywordChange = new EventEmitter();
@@ -151,10 +151,10 @@ export class LayoutToolbarComponent {
protected suggestList = toSignal(this.suggestList$);
protected toggleMenu() {
- this.menuOpenChange.emit(!this.menuOpen);
+ this.menuOpenChange.emit(!this.menuOpen());
}
protected toggleTheme() {
- this.themeChange.emit(this.theme === 'light' ? 'dark' : 'light');
+ this.themeChange.emit(this.theme() === 'light' ? 'dark' : 'light');
}
}
diff --git a/src/app/site-common/blog-post-subtitle.component.ts b/src/app/site-common/blog-post-subtitle.component.ts
index dcc36738c4..84c6b8d374 100644
--- a/src/app/site-common/blog-post-subtitle.component.ts
+++ b/src/app/site-common/blog-post-subtitle.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input } from '@angular/core';
+import { Component, input } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { RouterLink } from '@angular/router';
import { MarkdownMeta } from 'site-utils';
@@ -8,18 +8,18 @@ import { SlugifyPipe } from './slugify.pipe';
@Component({
selector: 'app-blog-post-subtitle',
template: `
- @if (postMeta) {
+ @if (postMeta()) {
date_range
- {{ postMeta.date.slice(0, 10) }}
+ {{ postMeta().date.slice(0, 10) }}
- @if ((postMeta.categories || []).length > 0) {
+ @if ((postMeta().categories || []).length > 0) {
folder_open
- @for (category of postMeta.categories; track category; let last = $last) {
+ @for (category of postMeta().categories; track category; let last = $last) {
();
}
diff --git a/src/app/site-common/liker-coin.component.ts b/src/app/site-common/liker-coin.component.ts
index 366b87ed51..8df4945eac 100644
--- a/src/app/site-common/liker-coin.component.ts
+++ b/src/app/site-common/liker-coin.component.ts
@@ -1,11 +1,11 @@
import {
ChangeDetectionStrategy,
Component,
- Input,
OnDestroy,
OnInit,
inject,
signal,
+ input
} from '@angular/core';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { Subscription } from 'rxjs';
@@ -34,7 +34,7 @@ export class LikerCoinComponent implements OnInit, OnDestroy {
private domSanitizer = inject(DomSanitizer);
private platformService = inject(PlatformService);
- @Input() likerId = '';
+ readonly likerId = input('');
protected likerCoinSrc = signal(
this.domSanitizer.bypassSecurityTrustResourceUrl('')
diff --git a/src/app/site-common/pagination.component.ts b/src/app/site-common/pagination.component.ts
index 9045191a3a..4fe744a094 100644
--- a/src/app/site-common/pagination.component.ts
+++ b/src/app/site-common/pagination.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
+import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { RouterLink } from '@angular/router';
import { MatTooltipModule } from '@angular/material/tooltip';
@@ -6,91 +6,91 @@ import { MatButtonModule } from '@angular/material/button';
@Component({
selector: 'app-pagination',
- template: `@if (currentPage > 1) {
+ template: `@if (currentPage() > 1) {
- } @if (currentPage > 1) {
+ } @if (currentPage() > 1) {
- } @if (currentPage > 3) {
+ } @if (currentPage() > 3) {
more_horiz
- } @if (currentPage > 2) {
+ } @if (currentPage() > 2) {
}
- @if (currentPage < totalPage - 1) {
+ @if (currentPage() < totalPage() - 1) {
- } @if (currentPage < totalPage - 2) {
+ } @if (currentPage() < totalPage() - 2) {
more_horiz
- } @if (currentPage < totalPage) {
+ } @if (currentPage() < totalPage()) {
- } @if (currentPage < totalPage) {
+ } @if (currentPage() < totalPage()) {