Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created May 9, 2020 18:22
Show Gist options
  • Save tkssharma/dfad179f4d3853ae0a602fadc2e44c42 to your computer and use it in GitHub Desktop.
Save tkssharma/dfad179f4d3853ae0a602fadc2e44c42 to your computer and use it in GitHub Desktop.
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent {
user$ = this.usersService.user$;
userWithPost$ = this.usersService.userWithPost$;
selectedUser$ = this.usersService.selectedUser$;
constructor(private usersService: UsersService) {}
selectUser(id) {
this.usersService.changeSelectedUser(id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment