
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
dfx-bootstrap-table
Advanced tools
An Angular Table CDK implementation for Bootstrap. Compatible with @ng-bootstrap/ng-bootstrap.
The ngb-table provides a Bootstrap Design styled data-table that can be used to display rows of data.
This table builds on the foundation of the CDK data-table and uses a similar interface for its data input and template, except that its element and attribute selectors will be prefixed with ngb- instead of cdk-. For more information on the interface and a detailed look at how the table is implemented, see the guide covering the CDK data-table.
Full credits go to the Angular and Angular Material Team. I literally copied most of their mat-table implementation and narrowed it down for Bootstrap.
npm install dfx-bootstrap-table@latest
npm install bootstrap@latest
npm install @angular/animations@latest
npm install @angular/forms@latest
Click me (or the video) for a faster version
You can run the demo with npm run demo
and vist it under http://localhost:4200
. more here;
Every code piece is located in src/app/
.
<!-- Filtering stuff -->
<form>
<div class='input-group'>
<input class='form-control' type='text' [formControl]='filter'
placeholder='Search' />
</div>
</form>
<table ngb-table [dataSource]='dataSource' ngb-sort>
<ng-container ngbColumnDef='id'>
<th *ngbHeaderCellDef ngb-header-cell ngb-sort-header>#</th>
<td *ngbCellDef='let event' ngb-cell>{{ event.id }}</td>
</ng-container>
<ng-container ngbColumnDef='name'>
<th *ngbHeaderCellDef ngb-header-cell ngb-sort-header>Name</th>
<td *ngbCellDef='let event' ngb-cell>{{ event.name }}</td>
</ng-container>
<ng-container ngbColumnDef='actions'>
<th *ngbHeaderCellDef ngb-header-cell>Actions</th>
<td *ngbCellDef='let event' ngb-cell>
<button
type='button'
class='btn btn-sm m-1 btn-outline-success'>
Edit
</button>
<button
type='button'
class='btn btn-sm m-1 btn-outline-danger'>
Delete
</button>
</td>
</ng-container>
<tr *ngbHeaderRowDef='columnsToDisplay' ngb-header-row></tr>
<tr *ngbRowDef='let event; columns: columnsToDisplay' ngb-row></tr>
</table>
export type eventModel = {
id: number,
name: string,
}
@Component({
selector: '...'
})
export class AppComponent implements OnInit {
// Filtering
public filter = new FormControl();
// Sorting
@ViewChild(NgbSort, {static: true}) sort: NgbSort | undefined;
public columnsToDisplay = ['id', 'name', 'actions'];
public dataSource: NgbTableDataSource<eventModel> = new NgbTableDataSource();
eventModels = [
{
id: 0,
name: 'Event 1'
},
{
id: 1,
name: 'Event 2'
},
{
id: 2,
name: 'Event 3'
},
{
id: 3,
name: 'Event 4'
},
];
ngOnInit(): void {
this.dataSource = new NgbTableDataSource<eventModel>(this.eventModels);
// Sort has to be set after template initializing
this.dataSource.sort = this.sort;
this.filter.valueChanges.subscribe((value) => {
this.dataSource.filter = value;
});
}
}
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {ReactiveFormsModule} from '@angular/forms';
import {DfxTableModule, DfxSortModule} from 'dfx-bootstrap-table';
@NgModule({
declarations: [...],
imports: [
BrowserAnimationsModule, // (probably) only once in your project
ReactiveFormsModule, // only if you use the filtering code
DfxTableModule,
DfxSortModule,
],
})
export class EventsModule {
}
Everything important in this library is located in projects/dfx-bootstrap-table
, thats the "real" library. (following commands still have to be executed at the root level)
npm install
Install all dependencies. Then run:
npm run demo
Visit the demo under http://localhost:4200
npm run-script watch
npm run-script build
dfx-bootstrap-table deployments are managed via .gitlab-ci
All builds are uploaded to releases.datepoll.org/common/dfx-bootstrap-table
Commits to the develop branch create a dev build downloadable via this link.
Tags create a release build downloadable via this link. Additionally a versioned zip is uploaded and the package is published to npm.
FAQs
Angular table CDK implementation for Bootstrap with filtering, sorting and pagination.
The npm package dfx-bootstrap-table receives a total of 64 weekly downloads. As such, dfx-bootstrap-table popularity was classified as not popular.
We found that dfx-bootstrap-table 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 uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.