codelab
codelab copied to clipboard
Create a button visible only to admins which would allow them to jump between prod (codelab.fun) and localhost
Add a new button to the list of buttons:

If the button is pressed on local environment, the user would be redirected to exactly the same page, but in prod, e.g.
http://localhost:4200/angular/forms/built-in -> https://codelab.fun/angular/forms/built-in
If the user is in prod, the user would be redirected to the local version
https://codelab.fun/angular/forms/built-in -> http://localhost:4200/angular/forms/built-in
To make the button visible only for admins: use oldIsAdmin$ Observable from AccessService To only display the button for admins.
Hello! I would like to try this once I have time :-)
Go for it.
After some thought, sounds like this would be a bit hard to test.
As half of the data comes from FireBase, and the other half from location, I'd recommend writing a unit test mocking both and testing there.
Let me know if you get stuck at any point.