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