This file contains 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 { Pipe, PipeTransform } from '@angular/core'; | |
import utils from '../utils/utils'; | |
@Pipe({ | |
name: 'simpleAgo' | |
}) | |
export class SimpleAgo implements PipeTransform { | |
transform(date: string): any { | |
let time = Number(date); | |
if ( time < 1000000000000) { | |
time = time * 1000; |
This file contains 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 { Pipe, PipeTransform } from '@angular/core'; | |
import utils from '../utils/utils'; | |
@Pipe({ | |
name: 'simpleAgo' | |
}) | |
export class DateConvert implements PipeTransform { | |
transform(date: string): any { | |
// console.log('date in the pipe:', date); | |
let time = Number(date); | |
if ( time < 1000000000000) { |
This file contains 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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'convert' | |
}) | |
export class HoursToMin implements PipeTransform { | |
transform(value: string): any { | |
const d = Number(value || 0) * 3600; | |
const h = Math.floor(d / 3600); | |
const m = Math.floor(d % 3600 / 60); |
This file contains 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
ISODateString(d) { | |
function pad(n) { return n < 10 ? '0' + n : n } | |
return d.getUTCFullYear() + '-' | |
+ pad(d.getUTCMonth() + 1) + '-' | |
+ pad(d.getUTCDate()) + 'T' | |
+ pad(d.getUTCHours()) + ':' | |
+ pad(d.getUTCMinutes()) + ':' | |
+ pad(d.getUTCSeconds()) + 'Z'; | |
} |
This file contains 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, HostListener, ElementRef, OnInit } from '@angular/core'; | |
@Directive({ selector: '[InputValidator]' }) | |
export class InputValidatorDirective implements OnInit { | |
el: any; | |
constructor(private elementRef: ElementRef) { | |
this.el = this.elementRef.nativeElement; | |
} |
This file contains 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, Input} from '@angular/core'; | |
@Directive({ | |
selector: '[onlyNumber]' | |
}) | |
export class OnlyNumberDirective { | |
@Input() | |
onlyNumber: boolean; |
This file contains 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, HostListener, HostBinding, EventEmitter, Output, Input } from '@angular/core'; | |
@Directive({ | |
selector: '[appDragAndDrop]' | |
}) | |
export class DragAndDropDirective { | |
@Input() private allowed_extensions: Array<string> = []; | |
@Output() private filesChangeEmiter: EventEmitter<File[]> = new EventEmitter(); | |
@Output() private filesInvalidEmiter: EventEmitter<File[]> = new EventEmitter(); | |
@HostBinding('style.background') private background = '#eee'; |
This file contains 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 { EventEmitter, ElementRef, OnInit, Directive, Input, Output } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { NgModel } from '@angular/forms'; | |
@Directive({ selector: '[debounce]' }) | |
export class DebounceDirective implements OnInit { | |
@Input() delay: number = 700; | |
@Output() keyUpFunc: EventEmitter<any> = new EventEmitter(); | |
constructor(private elementRef: ElementRef, private model: NgModel) { |
This file contains 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 { ErrorHandler, Injectable, Injector, NgZone } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
@Injectable() | |
export class AppErrorHandler implements ErrorHandler { | |
constructor(private injector: Injector) { } | |
handleError(error: any): void { | |
const routerService = this.injector.get(Router); |
This file contains 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
0-mail.com | |
0815.ru | |
0clickemail.com | |
0wnd.net | |
0wnd.org | |
10minutemail.com | |
20minutemail.com | |
2prong.com | |
30minutemail.com | |
3d-painting.com |
OlderNewer