Class Service

Hierarchy

Index

Constructors

constructor

  • new Service(enforcer: Symbol): Service

Properties

serviceName

serviceName: string = this.constructor.name

Static hasInstance

hasInstance: boolean = false

Static isSingleton

isSingleton: boolean = true

Static serviceAfterInit

serviceAfterInit: Subject<Service> = new Subject<Service>()

lifecycle hook

Accessors

Static instance

  • get instance(): any

Methods

Protected afterInit

  • afterInit(): void
  • calls only once per application life all observers are ready to listen service's events

    Returns void

Protected init

  • init(): void
  • calls only once per application life

    Returns void

Protected mounted

  • mounted(): void
  • calls only once per window life

    Returns void

Static createInstance

  • createInstance(ServiceClass: any): any
  • all services must be created via factory method

    Parameters

    • ServiceClass: any

    Returns any

Static getResourceId

  • getResourceId(resource: any): string
  • Parameters

    • resource: any

    Returns string

Static setupInitFunction

  • setupInitFunction(fn: function): void
  • replace init function

    Parameters

    • fn: function
        • Parameters

          Returns boolean

    Returns void

Static setupProxy

  • setupProxy(fn: function): void