clean code
This commit is contained in:
parent
357b55a94a
commit
fb6aa4c354
4 changed files with 8 additions and 20 deletions
|
|
@ -11,7 +11,7 @@ section {
|
|||
/*------------- ANIMATION -------------*/
|
||||
|
||||
.animation-coming-in {
|
||||
animation: coming-in 1s ease-in-out;
|
||||
animation: coming-in 250ms ease-in-out;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,18 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { UserService } from '../../../services/user.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ContactsComponent } from '../contacts.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-contact-detail',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
imports: [CommonModule, ContactsComponent],
|
||||
templateUrl: './contact-detail.component.html',
|
||||
styleUrl: './contact-detail.component.scss',
|
||||
})
|
||||
export class ContactDetailComponent {
|
||||
paramsId = '';
|
||||
@Input() paramsId: string = '';
|
||||
|
||||
constructor(public userService: UserService, private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.routeUserId();
|
||||
}
|
||||
|
||||
routeUserId() {
|
||||
if (this.route.params.subscribe()) {
|
||||
this.route.params.subscribe((params) => {
|
||||
this.paramsId = params['id'];
|
||||
});
|
||||
}
|
||||
}
|
||||
constructor(public userService: UserService) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,5 +68,5 @@
|
|||
} }
|
||||
</div>
|
||||
</div>
|
||||
<app-contact-detail></app-contact-detail>
|
||||
<app-contact-detail [paramsId]="paramsId"></app-contact-detail>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ export class ContactsComponent {
|
|||
allUsers: User[] = [];
|
||||
usersFirstLetter: string[] = [];
|
||||
usersByFirstLetter: { [key: string]: string[] } = {};
|
||||
userMap: { [key: string]: User } = {};
|
||||
paramsId = '';
|
||||
paramsId: string = '';
|
||||
|
||||
constructor(public userService: UserService, private route: ActivatedRoute) {
|
||||
this.userService.subUserList().subscribe(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue