CodeIgniter Forums
Retrieving a username in Angular - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: Libraries & Helpers (
+--- Thread: Retrieving a username in Angular (/showthread.php?tid=86795)

Retrieving a username in Angular - Sprint - 02-17-2023

What are the differences between components, directives, and services in Angular? Question I was asked in an angular interview and I was not able to answer it. The question is as follows:
Suppose you have a login screen and you enter a username and password to log in. Now after 5-6 pages or after n number of pages, there is a requirement that need username. How you will access the username there? My answer was I can use query param for it. Then the interviewer told it can be done by queryparams but that is not a good way to always carry a username in query params.
What is the correct answer to this? How it is done.