Skip to content

Latest commit

 

History

History
633 lines (208 loc) · 13.6 KB

tradinghistorycomponent.md

File metadata and controls

633 lines (208 loc) · 13.6 KB

cryptobot-interface > TradingHistoryComponent

Class: TradingHistoryComponent

Implements

  • OnDestroy
  • OnInit

Index

Constructors

Properties

Methods


Constructors

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


Properties

«Private» activatedRouter

● activatedRouter: ActivatedRoute

Defined in app/components/trading-history/trading-history.component.ts:94

Angular's ActivatedRoute service for knowing current route


busySubscription

● busySubscription: Subscription

Defined in app/components/trading-history/trading-history.component.ts:16

Makes unsubscribing from this variable possible in OnDestroy


firstTime

● 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.


«Private» gdaxDataService

● gdaxDataService: GdaxDataService

Defined in app/components/trading-history/trading-history.component.ts:96

Internal service to get queried market data.


isBusy

● 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

● 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

● 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

● page: number = 1

Defined in app/components/trading-history/trading-history.component.ts:38

Current page number


pageSubscription

● pageSubscription: Subscription

Defined in app/components/trading-history/trading-history.component.ts:42

Makes unsubscribing from this variable possible in OnDestroy


params

● 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

● 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

● queryParamSubscription: Subscription

Defined in app/components/trading-history/trading-history.component.ts:63

Makes unsubscribing from this variable possible in OnDestroy


«Private» router

● router: Router

Defined in app/components/trading-history/trading-history.component.ts:95

Angular's Router service for changing route


rowAmounts

● 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

● rowsPerPage: number = 10

Defined in app/components/trading-history/trading-history.component.ts:55

Number of rows to show per page


table

● 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

● tableDataSubscription: Subscription

Defined in app/components/trading-history/trading-history.component.ts:72

Makes unsubscribing from this variable possible in OnDestroy


tableReady

● 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

● 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

● urlSubscription: Subscription

Defined in app/components/trading-history/trading-history.component.ts:86

Makes unsubscribing from this variable possible in OnDestroy


Methods

changedPageNumber

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

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


«Private» handleRowsPerPageParam

handleRowsPerPageParam(): void

Defined in app/components/trading-history/trading-history.component.ts:208

Returns: void


«Private» ngOnDestroy

ngOnDestroy(): void

Defined in app/components/trading-history/trading-history.component.ts:102

Returns: void


ngOnInit

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

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

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