Options
All
  • Public
  • Public/Protected
  • All
Menu

YouTube data service

export

Hierarchy

  • AppDataService
    • YouTubeDataService

Index

Constructors

constructor

Properties

channelLoaded

channelLoaded: EventEmitter<__type>

emits event when @member loadChannel resolves

channelSetLoaded

channelSetLoaded: EventEmitter<__type>

emits event when @member loadChannelSet resolves

channelsIndexLoaded

channelsIndexLoaded: EventEmitter<__type>

emits event when @member loadChannelsIndex resolves

isError

isError: boolean

Returns true when the last API promise is rejected.

isLoaded

isLoaded: boolean

Returns true when the last API call loaded data without any errors.

isLoading

isLoading: boolean

Returns true when the API call is promising.

Static loadChannelMethodName

loadChannelMethodName: string = "loadChannel"

name of method on this class for Jasmine spies

Static loadChannelSetMethodName

loadChannelSetMethodName: string = "loadChannelSet"

name of method on this class for Jasmine spies

Static loadChannelsIndexMethodName

loadChannelsIndexMethodName: string = "loadChannelsIndex"

name of method on this class for Jasmine spies

Methods

getExecutor

  • getExecutor(uri: string, executorAction?: function, requestArgs?: RequestOptionsArgs): function
  • gets the executor for the constructor of @type {Promise}

    Parameters

    • uri: string
    • Optional executorAction: function
        • (response: Response, reject?: any): void
        • Parameters

          • response: Response
          • Optional reject: any

          Returns void

    • Optional requestArgs: RequestOptionsArgs

    Returns function

      • (resolve: function, reject: function): void
      • Parameters

        • resolve: function
            • (Response: any): void
            • Parameters

              • Response: any

              Returns void

        • reject: function
            • (any: any): void
            • Parameters

              • any: any

              Returns void

        Returns void

Private initialize

  • initialize(): void

initializeLoadState

  • initializeLoadState(): void
  • initializes App data-loading state

    Returns void

loadChannel

  • loadChannel(channelId: string): Promise<Response>

loadChannelSet

  • loadChannelSet(suffix: string, id: string): Promise<Response>

loadChannelsIndex

  • loadChannelsIndex(suffix: string): Promise<Response>

loadJson

  • loadJson<TFromJson>(uri: string, responseAction: function, requestArgs?: RequestOptionsArgs): Promise<Response>
  • loads JSON from the specified URI

    Type parameters

    • TFromJson

    Parameters

    • uri: string
    • responseAction: function
        • (json: TFromJson, reject?: any): void
        • Parameters

          • json: TFromJson
          • Optional reject: any

          Returns void

    • Optional requestArgs: RequestOptionsArgs

    Returns Promise<Response>

Static getItems

Static getItemsMap

  • getItemsMap(json: __type): Map<string, YouTubeItem[]>

Generated using TypeDoc