Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Задание на проверку ТГ: @my4kish #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

my4kish
Copy link

@my4kish my4kish commented Nov 7, 2024

ТГ: @my4kish

@my4kish my4kish closed this Nov 9, 2024
@my4kish my4kish reopened this Nov 9, 2024
@@ -0,0 +1,19 @@
<mat-toolbar class="header">
<!-- <button mat-icon-button class="example-icon" aria-label="Example icon-button with menu icon">

Choose a reason for hiding this comment

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

удалите комментарии

import { HttpClient } from "@angular/common/http";
import { inject, Injectable } from "@angular/core";

@Injectable({providedIn: 'root'})

Choose a reason for hiding this comment

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

форматирование слетело

readonly data = inject(MAT_DIALOG_DATA)
readonly dialogRef = inject(MatDialogRef<CreateEditUserDialogComponent>);

// @Output()

Choose a reason for hiding this comment

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

удалите комментарии

standalone: true,
})
export class CreateEditUserDialogComponent{
readonly data = inject(MAT_DIALOG_DATA)

Choose a reason for hiding this comment

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

добавьте модификаторы доступа private или public

export const UsersActions = createActionGroup({
source: 'Users',
events: {
'set': props<{users: User[]}>(),

Choose a reason for hiding this comment

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

можно убрать кавычки для ключей объекта, так как все они целые слова

private readonly usersApiService = inject(UsersApiService);
private readonly dialog = inject(MatDialog);
private isEdit: Boolean = false;
private readonly store = inject(Store);

Choose a reason for hiding this comment

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

инжектирование зависимостей пишите выше

}

public openDialog(user?: User): void {
this.isEdit = user !== undefined

Choose a reason for hiding this comment

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

вручную прописывать undefined является плохой практикой, лучше null или же в вашем случае false, потому что переменная назвалась через is

}
});

dialogRef.afterClosed().subscribe(result => {

Choose a reason for hiding this comment

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

добавьте отписку

);
}

public editUser(user: any) {

Choose a reason for hiding this comment

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

не используйте any

src/styles.scss Outdated
display: block;
}

/**

Choose a reason for hiding this comment

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

удалите все комментарии и лишние пустые строки

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