fixed problem about user.id in new user creation
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6"> <button class="btn btn-primary btn-sm" (click)="updateUser()"><fa-icon [icon]="faPen">ciao</fa-icon></button>
|
||||
</div>
|
||||
<div class="col-sm-6"> <button class="btn btn-primary btn-sm" routerLink="{{user.id}}"><fa-icon [icon]="faSearch"></fa-icon></button>
|
||||
<div class="col-sm-6"> <button class="btn btn-primary btn-sm" (click)="showUser()"><fa-icon [icon]="faSearch"></fa-icon></button>
|
||||
</div>
|
||||
<div class="col-sm-6"> <button class="btn btn-danger btn-sm" (click)="deleteUser()"><fa-icon [icon]="faTrash"></fa-icon></button>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@ export class UserComponent implements OnInit {
|
||||
faSearch=faSearch;
|
||||
constructor(private userService:UserService, private route: Router){
|
||||
this.user = {
|
||||
id:0,
|
||||
id:'0',
|
||||
name: '',
|
||||
lastname: '',
|
||||
email: '',
|
||||
@@ -43,10 +43,15 @@ export class UserComponent implements OnInit {
|
||||
|
||||
this.userDeleted.emit(this.user);
|
||||
|
||||
}
|
||||
showUser(){
|
||||
this.route.navigateByUrl('/users/' + this.user.id )
|
||||
// this.userSelected.emit(this.user);
|
||||
|
||||
}
|
||||
updateUser(){
|
||||
this.route.navigateByUrl('/users/' + this.user.id + '/edit')
|
||||
this.userSelected.emit(this.user);
|
||||
// this.userSelected.emit(this.user);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user