projects/congarevenuecloud/ecommerce/src/lib/modules/crm/services/account.service.ts
The account service provides methods for interacting with the accounts the user has access to.
import { AccountService, AObjectService} from '@congarevenuecloud/ecommerce';
export class MyComponent implements OnInit{
constructor( private accountService: AccountService)
}
// or
export class MyService extends AObjectService {
private accountService: AccountService = this.injector.get(AccountService);
}
AObjectService
Properties |
Methods |
getAccount | ||||||||
getAccount(accountId: string)
|
||||||||
Retrieves the account information based on the account id passed. Example:Example :
Parameters :
Returns :
Observable<Account>
an observable instance of Account. |
getCurrentAccount |
getCurrentAccount()
|
Decorators :
@MemoizeAll()
|
Retrieves the current active account in the application Example:Example :
Returns :
Observable<Account>
an observable containing the account record. |
setAccount | ||||||||
setAccount(account: Account | string)
|
||||||||
Sets the selected account to be the current active account for order-on-behalf functions. Will store the selected account record in local storage Example:Example :
Parameters :
Returns :
Observable<Account>
an observable containing the account record that was set to active. |
type |
Default value : Account
|