cryptobot-interface > TradingHistoryComponent
OnDestroy
OnInit
- activatedRouter
- busySubscription
- firstTime
- gdaxDataService
- isBusy
- isNoNextPage
- isNoPrevPage
- page
- pageSubscription
- params
- pathState
- queryParamSubscription
- router
- rowAmounts
- rowsPerPage
- table
- tableDataSubscription
- tableReady
- timeoutId
- urlSubscription
- changedPageNumber
- changedRowsPerPage
- handleRowsPerPageParam
- ngOnDestroy
- ngOnInit
- updateParams
- updateTable
⊕ new TradingHistoryComponent(activatedRouter: ActivatedRoute
, router: Router
, gdaxDataService: GdaxDataService): TradingHistoryComponent
Defined in app/components/trading-history/trading-history.component.ts:86
Constructor for the class. Injects Angular's ActivatedRoute, and Router services
Parameters:
Param | Type | Description |
---|---|---|
activatedRouter | ActivatedRoute |
Angular's ActivatedRoute service for knowing current route |
router | Router |
Angular's Router service for changing route |
gdaxDataService | GdaxDataService | Internal service to get queried market data. |
Returns: TradingHistoryComponent
● activatedRouter: ActivatedRoute
Defined in app/components/trading-history/trading-history.component.ts:94
Angular's ActivatedRoute service for knowing current route
● busySubscription: Subscription
Defined in app/components/trading-history/trading-history.component.ts:16
Makes unsubscribing from this variable possible in OnDestroy
● firstTime: boolean
[] = [true, true]
Defined in app/components/trading-history/trading-history.component.ts:21
Array of flags to determine if initial param and url pull is done before triggering the service to query for data. First is currencyType. Second is rowsPerPage.
● gdaxDataService: GdaxDataService
Defined in app/components/trading-history/trading-history.component.ts:96
Internal service to get queried market data.
● isBusy: boolean
= true
Defined in app/components/trading-history/trading-history.component.ts:26
Checks with service to see if it's busy in a query, and puts table in standby mode until it's ready.
● isNoNextPage: boolean
= false
Defined in app/components/trading-history/trading-history.component.ts:30
Flag to disable next page button if there is no more data.
● isNoPrevPage: boolean
= true
Defined in app/components/trading-history/trading-history.component.ts:34
Flag to disable previous page button if user is on first page.
● page: number
= 1
Defined in app/components/trading-history/trading-history.component.ts:38
Current page number
● pageSubscription: Subscription
Defined in app/components/trading-history/trading-history.component.ts:42
Makes unsubscribing from this variable possible in OnDestroy
● params: ParamMap
Defined in app/components/trading-history/trading-history.component.ts:46
Holds query params to check against in other parts of component
● pathState: string
= "BTC-USD"
Defined in app/components/trading-history/trading-history.component.ts:51
The initial path state passed in by the activatedRouter. Keeps track of what currency the chart should be viewing.
● queryParamSubscription: Subscription
Defined in app/components/trading-history/trading-history.component.ts:63
Makes unsubscribing from this variable possible in OnDestroy
● router: Router
Defined in app/components/trading-history/trading-history.component.ts:95
Angular's Router service for changing route
● rowAmounts: number
[] = [10, 25, 50, 75]
Defined in app/components/trading-history/trading-history.component.ts:59
Options for number of rows to show per page
● rowsPerPage: number
= 10
Defined in app/components/trading-history/trading-history.component.ts:55
Number of rows to show per page
● table: __type
[] = []
Defined in app/components/trading-history/trading-history.component.ts:68
The main table object to be constructed whenever new data is returned from the service.
● tableDataSubscription: Subscription
Defined in app/components/trading-history/trading-history.component.ts:72
Makes unsubscribing from this variable possible in OnDestroy
● tableReady: boolean
= false
Defined in app/components/trading-history/trading-history.component.ts:77
The initial path state passed in by the activatedRouter. Keeps track of what currency the chart should be viewing.
● timeoutId: any
= null
Defined in app/components/trading-history/trading-history.component.ts:82
The main table object to be constructed whenever new data is returned from the service.
● urlSubscription: Subscription
Defined in app/components/trading-history/trading-history.component.ts:86
Makes unsubscribing from this variable possible in OnDestroy
► changedPageNumber(direction: string
): void
Defined in app/components/trading-history/trading-history.component.ts:170
Called when user clicked next or previous page button
Parameters:
Param | Type | Description |
---|---|---|
direction | string |
'prev' for previous page, 'next' for next page |
Returns: void
► changedRowsPerPage(newRowsPerPage: number
): void
Defined in app/components/trading-history/trading-history.component.ts:190
Called when user clicked a different rows per page choice
Parameters:
Param | Type | Description |
---|---|---|
newRowsPerPage | number |
new rows per page choice |
Returns: void
► handleRowsPerPageParam(): void
Defined in app/components/trading-history/trading-history.component.ts:208
Returns: void
► ngOnDestroy(): void
Defined in app/components/trading-history/trading-history.component.ts:102
Returns: void
► ngOnInit(): void
Defined in app/components/trading-history/trading-history.component.ts:130
Triggered when component is loaded, but before it is viewed. Gets REST path info, and updates the history table.
Returns: void
► updateParams(params: __type
): void
Defined in app/components/trading-history/trading-history.component.ts:235
Called when params need updating. Avoids repetition.
Parameters:
Param | Type | Description |
---|---|---|
params | __type |
param object used to update queryParams |
Returns: void
► updateTable(data: __type
[]): void
Defined in app/components/trading-history/trading-history.component.ts:246
When new data is received, it's passed to this function. Here the table details are assembled, and the tableReady flag is released.
Parameters:
Param | Type | Description |
---|---|---|
data | __type [] |
queried trading history data passed from the GdaxDataService. |
Returns: void