🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@qlee/ng-csv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qlee/ng-csv

### Import Module ```typescript import { NgCsvModule } from '@qlee/ng-csv';

0.0.3
latest
npm
Version published
Maintainers
1
Created
Source

NgCsv

Import Module

import { NgCsvModule } from '@qlee/ng-csv';

@NgModule({
  declarations: [],
  imports: [ NgCsvModule ],
  providers: [],
  bootstrap: []
})
export class AppModule { }

Upload csv

<button ngCsv (upload)="upload($event)">选择文件</button>
class Component {
  upload(data: Observable<any>) {
      data.pipe(
        scan((all: string[], row: any[]) => [...all, row], [])
      ).subscribe(rows => this.data = rows);
    }
}

Download

import { of } from 'rxjs';
import { NgCsvService } from '@qlee/ng-csv';

class Component {
  constructor(private ngCsvService: NgCsvService) {}
  
  download() {
      this.ngCsvService.download('test.csv', of({ name: 1, age: '222,asd' }, { name: 2 }));
  }
}

FAQs

Package last updated on 16 Aug 2019

Did you know?

Socket

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.

Install

Related posts