天天看点

SAP Spartacus B2BUserService的一个问题

This issue is for discussion in this StackOverflow question:

https://stackoverflow.com/questions/66458798/how-can-i-detect-current-users-user-group-in-spartacus
SAP Spartacus B2BUserService的一个问题

In order to test it, I add the following source code in AppModule’s constructor:

SAP Spartacus B2BUserService的一个问题

I expect the user group data is printed.

Unfortunately I meet with this error message:

ERROR TypeError: Cannot read property ‘b2bUser’ of undefined

SAP Spartacus B2BUserService的一个问题

callstack:

SAP Spartacus B2BUserService的一个问题

Do I need to call some other method to “initialize” the state before I access it?

继续阅读