Installation
Available Services
The Angular adapter exports four services, one for each zoom mode:ZoomImageWheelService- Zoom with mouse wheel/pinch gesturesZoomImageHoverService- Zoom on hover with a separate zoom targetZoomImageMoveService- Zoom follows mouse/touch movementZoomImageClickService- Toggle zoom on click
Service API
Each service provides:createZoomImage()- Method to initialize zoom on a container elementzoomImageState$- Observable of the current statezoomImageState- Current state valuesetZoomImageState()- Method to update state (available for wheel and hover)
Wheel Zoom
Zoom in and out using the mouse wheel or pinch gestures. Supports programmatic zoom control, rotation, and image cropping.Basic Example
Complete Example with Controls
State Properties
currentZoom: number- Current zoom level (1 = 100%)enable: boolean- Whether zoom is enabledcurrentPositionX: number- X position offsetcurrentPositionY: number- Y position offsetcurrentRotation: number- Rotation angle in degrees
Hover Zoom
Display a zoomed version in a separate container when hovering over the image.Basic Example
State Properties
enabled: boolean- Whether hover is activezoomedImgStatus: string- Loading status (“idle” | “loading” | “loaded”)
Move Zoom
Zoom follows the mouse or touch movement within the image container.Basic Example
State Properties
zoomedImgStatus: string- Loading status (“idle” | “loading” | “loaded”)
Click Zoom
Toggle between zoomed and normal states by clicking the image.Basic Example
State Properties
zoomedImgStatus: string- Loading status (“idle” | “loading” | “loaded”)
TypeScript Support
All services are fully typed. Import types from@zoom-image/core:
RxJS Observables
Each service exposes state through RxJS observables (zoomImageState$). You can use standard RxJS operators:
Service Providers
Remember to add the service to your component’sproviders array:
Cleanup
All services implementOnDestroy and automatically clean up when the component is destroyed.