Loading...
Loading...
Common utilities and features for Syncfusion Angular components. Use this skill when the user needs to implement animations, drag-and-drop, state persistence, RTL support, localization, globalization, security, templates, and advanced features for Syncfusion Angular components.
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-commonng addng add @syncfusion/ej2-angular-grids@import "../node_modules/@syncfusion/ej2-base/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-calendars/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-dropdowns/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css";
@import "../node_modules/@syncfusion/ej2-angular-grids/styles/tailwind3.css";// src/main.ts
import { registerLicense } from '@syncfusion/ej2-base';
// Call this before initializing any Syncfusion components
registerLicense('Your license key here');import { Component } from '@angular/core';
import { GridModule, PageService } from '@syncfusion/ej2-angular-grids';
@Component({
selector: 'app-root',
standalone: true,
imports: [GridModule],
providers: [PageService],
template: `
<ejs-grid [dataSource]="data" [allowPaging]="true">
<e-columns>
<e-column field="OrderID" width="100"></e-column>
<e-column field="CustomerID" width="100"></e-column>
<e-column field="Freight" width="100" format="C2"></e-column>
</e-columns>
</ejs-grid>
`
})
export class AppComponent {
data = [
{ OrderID: 10248, CustomerID: 'VINET', Freight: 32.38 },
{ OrderID: 10249, CustomerID: 'TOMSP', Freight: 11.61 }
];
}<ejs-grid
id="persistGrid"
[dataSource]="data"
[enablePersistence]="true"
>
<!-- Component content -->
</ejs-grid>import { enableRtl } from '@syncfusion/ej2-base';
// Global RTL enablement
enableRtl(true);
// OR per-component
<ejs-grid [dataSource]="data" enableRtl="true"></ejs-grid>import { Component, ViewChild } from '@angular/core';
import { Animation } from '@syncfusion/ej2-base';
@Component({
template: `<div #element class="box"></div>`
})
export class AnimationComponent {
@ViewChild('element') element!: any;
ngAfterViewInit() {
const animation = new Animation({ duration: 5000, delay: 2000 });
animation.animate(this.element.nativeElement, { name: 'FadeOut' });
}
}import { Component, ViewChild } from '@angular/core';
import { Draggable, Droppable } from '@syncfusion/ej2-base';
@Component({
template: `
<div #draggable id="draggable">Drag me</div>
<div #droppable id="droppable">Drop here</div>
`
})
export class DragDropComponent {
@ViewChild('draggable') draggable!: any;
@ViewChild('droppable') droppable!: any;
ngAfterViewInit() {
new Draggable(this.draggable.nativeElement, { clone: false });
new Droppable(this.droppable.nativeElement, {
drop: (e) => {
console.log('Dropped!', e.droppedElement);
}
});
}
}