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;
}
2 Answer(s)
-
0
Hi, currently
app-session
service has been injected inapp-component-base
.you can access current user info via
this.appService.getUser()
in your component. -
0
Thank you, I solved it.
Have an answer to this question?
Log in
and write your answer.