Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
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 78,554 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.