projects/congarevenuecloud/ecommerce/src/lib/modules/crm/services/user.service.ts
The User service provides methods for getting current user related details.
import { UserService, AObjectService } from '@congarevenuecloud/ecommerce';
constructor(private userService: UserService) {}
// or
export class MyService extends AObjectService {
private userService: UserService = this.injector.get(UserService);
}
AObjectService
Properties |
|
Methods |
getBrowserLocale | ||||||||||
getBrowserLocale(underscore: boolean)
|
||||||||||
Retrieves the browser locale for the current user Example:Example :
Parameters :
Returns :
any
|
getCurrentUser |
getCurrentUser()
|
Method gets active user. Example:Example :
Returns :
Observable<User>
observable instance of the active user. |
getCurrentUserLocale | ||||||||||
getCurrentUserLocale(underscore: boolean)
|
||||||||||
Retrieves the current user locale to support salesforce and other environment Example:Example :
Parameters :
Returns :
Observable<string>
return an observable string for current user locale. |
initializeGuestUser |
initializeGuestUser()
|
Method is used to create a guest user record prior to registration. Will set the defaults on the record to browser defaults. Example:Example :
Returns :
Observable<User>
a user record containing the browser defaults (will not be committed to db). |
login |
login()
|
Primary method responsible to log a user in to Conga platform Example:Example :
Returns :
void
|
logout |
logout()
|
Primary method responsible to log a user out of Conga platform
Returns :
void
|
me |
me()
|
Primary method for retrieving the current user record. Example:Example :
Returns :
Observable<User>
an observable of type User. |
onInit |
onInit()
|
Returns :
void
|
setCurrency | |||||||||||||||
setCurrency(currencyIsoCode: string, commit: boolean)
|
|||||||||||||||
Method sets the currency for the current user. Example:Example :
Parameters :
Returns :
Observable<User>
observable instance of current user with updated currency. |
setLocale | ||||||||
setLocale(locale: string)
|
||||||||
Method sets the locale for the current user. Example:Example :
Parameters :
Returns :
Observable<void>
an empty observable. |
setUserDefaults | ||||||||
setUserDefaults(user: User)
|
||||||||
Method sets the defaults like language, locale & email encoding type for user Example:Example :
Parameters :
Returns :
void
|
updateCurrentUser | ||||||||
updateCurrentUser(user: User)
|
||||||||
Method updates the user details. Example:Example :
Parameters :
Returns :
Observable<User>
an observable of the updated user. |
apiService |
Type : ApiService
|
Default value : this.injector.get(ApiService)
|
Protected CACHE_KEY |
Type : string
|
Default value : 'User'
|
securityService |
Type : OidcSecurityService
|
Default value : this.injector.get(OidcSecurityService)
|
type |
Default value : User
|