This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {environment} from "../../../environments/environment"; | |
export type ClassConstructor = {new(...args:any[]):{}, prototype: any}; | |
export interface MockingParams<T, K> { | |
mockClass: T; | |
targetMembers: K[]; | |
force?: boolean; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import {Subject} from 'rxjs/Rx'; | |
import {PlatformLocation} from '@angular/common'; | |
@Injectable() | |
export class WebWorkerService { | |
worker; | |
workerResult: {[key: string]: Subject<any> } = {} ; | |
workerUrl = window.location.origin +this.platformLocation.getBaseHrefFromDOM() + 'assets/scripts/worker.js'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-04-19T15:11:42.157Z","extensionVersion":"v3.2.9"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get an item from an array collection by id | |
*/ | |
const getByIdFromArray = module.exports.getByIdFromArray = function getByIdFromArray(collection = []) { | |
return function(id = '') { | |
return collection.find((item = {}) => item.id === id); | |
} | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const waitForEach = (processFunc , [head, ...tail]) => | |
!head | |
? Promise.resolve() | |
: processFunc(head).then(waitForEach(processFunc , tail)); | |
// example of usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Directive, ElementRef, Output, EventEmitter, HostListener} from '@angular/core'; | |
@Directive({ | |
selector: '[appClickOutside]' | |
}) | |
export class ClickOutsideDirective { | |
constructor(private _elementRef: ElementRef) { | |
} | |
@Output() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Directive, ElementRef, HostListener} from '@angular/core'; | |
@Directive({ | |
selector: '[appMyScroll]' | |
}) | |
export class ItsMyScrollDirective { | |
constructor(private _elementRef: ElementRef ) { | |
} | |