Skip to content

Instantly share code, notes, and snippets.

View plachy-jozef's full-sized avatar
💭
Funky late night education

Jozef Plachy plachy-jozef

💭
Funky late night education
View GitHub Profile
@derekshi
derekshi / csv-downloader.ts
Last active July 2, 2020 10:54
ng2-csv-downloader (Angular2 CSV Downloader): Simple Angular 2 Component for downloading any data as csv.
import {Component, Input, Output, EventEmitter, Renderer} from '@angular/core';
@Component({
selector: 'csv-downloader',
template: `
<button class='btn btn-info' (click)="build()">{{downloaderName}}</button>
`
})
export class CsvDownloader {
@Input() downloaderName: string = 'Download CSV';
@Input() headers: string[] = [];
@jnizet
jnizet / confirm-modal-and-service.ts
Last active October 27, 2022 16:54
How to create a reusable service allowing to open a confirmation modal from anywhere with ng-bootstrap
import { Component, Injectable, Directive, TemplateRef } from '@angular/core';
import { NgbModal, NgbModalRef, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
/**
* Options passed when opening a confirmation modal
*/
interface ConfirmOptions {
/**
* The title of the confirmation modal
*/