Skip to main content

Home > @jsplumbtoolkit/browser-ui-angular > jsPlumbService > getSurface

jsPlumbService.getSurface() method#

Gets the surface with the given id, passing it to the supplied callback function. If a surface with the given ID does not exist, the request is queued, and then if a surface with the given ID is subsequently registered, each callback for that surface registered via this method is executed in turn.


getSurface(id: string, callback: (surface: Surface) => void, _params?: SurfaceOptions): void;


idstringID of the surface to retrieve
callback(surface: Surface) => voidFunction to call when the surface has been retrieved.
_paramsSurfaceOptionsOptional parameters to pass back into the callback upon successful retrieval of the surface.