-
Notifications
You must be signed in to change notification settings - Fork 140
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
base: master
Are you sure you want to change the base?
Conversation
src/app/header/header.component.html
Outdated
@@ -0,0 +1,19 @@ | |||
<mat-toolbar class="header"> | |||
<!-- <button mat-icon-button class="example-icon" aria-label="Example icon-button with menu icon"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
удалите комментарии
src/app/users-api.service.ts
Outdated
import { HttpClient } from "@angular/common/http"; | ||
import { inject, Injectable } from "@angular/core"; | ||
|
||
@Injectable({providedIn: 'root'}) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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[]}>(), |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавьте отписку
); | ||
} | ||
|
||
public editUser(user: any) { |
There was a problem hiding this comment.
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; | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
удалите все комментарии и лишние пустые строки
ТГ: @my4kish