Skip to content

Conversation

@manhpd
Copy link

@manhpd manhpd commented Apr 13, 2025

  • Upgrade angular to version 19
  • Upgrade multiple library to recent version
  • Change the app to zoneless

export class AlbumComponent {
album$ = this.store.album$;
album = toSignal(this.store.album$,{ initialValue: null });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nếu template đọc album trực tiếp (album()), kiểm tra null trước khi truy cập thuộc tính: album()?.name hoặc dùng ngIf để tránh lỗi.

standalone: false
})
export class ClickStopPropagationDirective {
@HostListener('click', ['$event']) onClick(e: MouseEvent) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cách dùng @directive + @HostListener để đóng gói một hành vi click nhỏ thành directive, giúp component gọn hơn và tăng khả năng tái sử dụng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants