Skip to content

Instantly share code, notes, and snippets.

@krzyhan
krzyhan / toastr-translate-service.ts
Last active July 22, 2020 18:29
Service for showing toast with translated message (and title)
import { Injectable } from '@angular/core';
import { ToastrService, IndividualConfig, ActiveToast } from 'ngx-toastr';
import { TranslateService } from '@ngx-translate/core';
@Injectable({
providedIn: 'root'
})
export class ToastrTranslateService {
constructor(private toastrService: ToastrService, private translateService: TranslateService) {}
@krzyhan
krzyhan / types_for_jspdf_v1_5.4.js
Last active February 17, 2020 15:33
Type definitions for jsPDF 1.5.4, works in Visual Code, based on https://github.com/MrRio/jsPDF/blob/master/types/index.d.ts
// Type definitions for jsPDF 1.5.4
// Project: https://github.com/MrRio/jsPDF
// Definitions by: Amber Schühmacher <https://github.com/amberjs>
// Kevin Gonnord <https://github.com/lleios>
// Jackie Weng <https://github.com/jemerald>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "jspdf" {
import construct = Reflect.construct;
getDocsList = function() {
var elements = document.getElementsByClassName('myx-color-base myx-text-overflow inline_myx myx-text-align');
var data = '';
for(var i = 0; i < elements.length; i++) {
data += elements[i].title + '\n';
}
console.log(data);