Jump to login.component.ts - Angular 6 Login Component. The login component uses the authentication service to login and logout of the application. It automatically logs the user out when it initializes (ngOnInit) so the login page can also be used to logout..