
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
angular-gridster2
Advanced tools
What Angular supports here
npm install angular-gridster2 --save
import {Component} from '@angular/core';
import {GridsterComponent, GridsterItemComponent} from 'angular-gridster2';
@Component({
standalone: true,
imports: [GridsterComponent, GridsterItemComponent],
...
})
<gridster [options]="options">
@for (item of dashboard; track item) {
<gridster-item [item]="item">
<!-- your content here -->
</gridster-item>
}
</gridster>
Initialize a simple dashboard:
import { GridsterConfig, GridsterItem } from 'angular-gridster2';
options: GridsterConfig;
dashboard: Array<GridsterItem>;
static itemChange(item, itemComponent) {
console.info('itemChanged', item, itemComponent);
}
static itemResize(item, itemComponent) {
console.info('itemResized', item, itemComponent);
}
ngOnInit() {
this.options = {
itemChangeCallback: AppComponent.itemChange,
itemResizeCallback: AppComponent.itemResize,
};
this.dashboard = [
{cols: 2, rows: 1, y: 0, x: 0},
{cols: 2, rows: 2, y: 0, x: 2}
];
}
changedOptions() {
this.options.api.optionsChanged();
}
removeItem(item) {
this.dashboard.splice(this.dashboard.indexOf(item), 1);
}
addItem() {
this.dashboard.push({});
}
iFrames can interfere with drag/resize of widgets. For a workaround please read this issue #233
Option 1 (without text selection):
<gridster-item>
<div (mousedown)="$event.stopPropagation()" (touchstart)="$event.stopPropagation()">Some content to click without dragging the widget</div>
<div class="item-buttons">
<button class="drag-handler">
<md-icon>open_with</md-icon>
</button>
<button class="remove-button" (click)="removeItem($event, item)" (touchstart)="removeItem($event, item)">
<md-icon>clear</md-icon>
</button>
</div>
</gridster-item>
Option 2 (with text selection):
<gridster-item>
<div class="gridster-item-content">Some content to select and click without dragging the widget</div>
<div class="item-buttons">
<button class="drag-handler">
<md-icon>open_with</md-icon>
</button>
<button class="remove-button" (click)="removeItem($event, item)" (touchstart)="removeItem($event, item)">
<md-icon>clear</md-icon>
</button>
</div>
</gridster-item>
The MIT License
Copyright (c) 2024 Tiberiu Zuld
FAQs
Angular gridster 2
The npm package angular-gridster2 receives a total of 102,661 weekly downloads. As such, angular-gridster2 popularity was classified as popular.
We found that angular-gridster2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.