How to Enable Snap to Shape by Default in Angular Designer Applications
Published:
Updated:
The Snap-to-Shape feature in the Bold Reports Designer helps users align report items accurately by displaying snap lines when items are moved or resized. This article explains how to enable the isEnableSnapLine property by default in an Angular application.
Step-by-Step Instructions
Step 1: Update the app.component.ts File
- Modify the component to access the Bold Reports Designer instance and enable the Snap-to-Shape feature.
export class DesignerComponent {
public serviceUrl: string;
private designer: any;
constructor() {
// Update this to your Bold Reports API endpoint
this.serviceUrl = '[insert your API endpoint here]';
}
ngAfterViewInit() {
// Access the Designer instance and enable Snap to Shape.
this.designer = $('#designer').data('boldReportDesigner');
this.designer.isEnableSnapLine = true;
}
}
isEnableSnapLine Property Description
| Property Name | Description |
|---|---|
isEnableSnapLine |
A Boolean property that enables or disables the Snap-to-Shape feature. When set to true, alignment guides (snap lines) are displayed while moving or resizing report items. |
Step 2: Verify the Configuration
- Save the changes and run the Angular application.
- Open the Bold Reports Designer.
- Drag, move, or resize report items on the design surface.
- Verify that snap lines appear automatically to help align report items.
Summary
Enabling Snap-to-Shape by default improves design accuracy and enhances the overall report-designing experience in Angular applications that use the Bold Reports Designer.
Download the sample application here.