When page load first time at that time I am displaying grid view with current user details.
Now in that I have added one checkbox.
So when user click on that checkbox then that grid should updated with all users list. Again if user uncheck that checbox so only see current user details.
Below is my code for that
**So I have two questions :
- Is this correct way what I am following ?
- What argument I need to pass when I call function from ngAfterViewInit**
<mat-checkbox (change)="showAllUsers($event)">
Show All
</mat-checkbox>
showAllUsers(event:MatCheckboxChange){
if(event.checked){
this.getUsers();
} else {
this.getUsersById();
}
}
Now I am trying to call this function from ngAfterViewInit..
ngAfterViewInit(){
this.showAllCompanies($event.);
}
**So I have two questions :
- Is this correct way what I am following ?
- What argument I need to pass when I call function from ngAfterViewInit**