0
GSOFT created
Suppose I have a variable used to store current user, I use this variable to filter data. Where should I put the code below? And How can I use it across all components?
async getCurrentLoginInformations(): Promise<string>{
let result = await this._sessionAppService.getCurrentLoginInformations().toPromise();
this.userIdFilter = result.user.userName;
if (this.userIdFilter == 'admin')
{this.userIdFilter = '';}
return this.userIdFilter;
}
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
Hi, currently
app-sessionservice has been injected inapp-component-base.you can access current user info via
this.appService.getUser()in your component.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you, I solved it.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)