I used ng generate
to create a service. I initialize an array and change a flag, but when I route to a different page the array is empty and the flag is false.
My service starts with
@Injectable({
providedIn: 'root'
})
I understood that would create a application-wide singleton service, but I've only used services on single page applications before now. Is it different with multi-page applications/routing?
edit: I've tried the field's as static which did not work either.
edit 2: This is more or less my problem: angular-7bp9kn.stackblitz.io Initialize on the home page, and display (true). Navigate to admin (after it's been initialized on home) and display (false).