Is it possible to access the 'Context' object from outside the controllers, such as within a simple utility class like 'UiUtils'?
For instance:
export class UiUtils {
static getCurrentUsername() {
return StaticContext.user?.email; //StaticContext is Foal Context instance
}
}
The rationale (in a non-single page application):
In a UI template, we require the ability to consistently display the current username, regardless of the active controller.
Is it possible to access the 'Context' object from outside the controllers, such as within a simple utility class like 'UiUtils'? For instance:
The rationale (in a non-single page application): In a UI template, we require the ability to consistently display the current username, regardless of the active controller.