Help Angular by taking a 1 minute survey!Go to surveyHome

ServiceMessageBroker

Helper class for UIComponents that allows components to register methods. If a registered method message is received from the broker on the worker, the UIMessageBroker deserializes its arguments and calls the registered method. If that method returns a promise, the UIMessageBroker returns the result to the worker.

      
      interface ServiceMessageBroker {
  registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
}
    

Methods

registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
      
      registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
    
Parameters
methodName string
signature (Type | SerializerTypes)[]
method (..._: any[]) => void | Promise
returnType Type | SerializerTypes

Optional. Default is undefined.

Returns

void