-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
272 additions
and
80 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
projects/ng-helpers/src/directives/click-outside/click-outside.directive.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ClickOutsideDirective } from './click-outside.directive'; | ||
|
||
describe('ClickOutsideDirective', () => { | ||
it('should create an instance', () => { | ||
const directive = new ClickOutsideDirective(); | ||
expect(directive).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
projects/ng-helpers/src/directives/click-outside/click-outside.directive.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[libClickOutside]' | ||
}) | ||
export class ClickOutsideDirective { | ||
|
||
constructor() { } | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
projects/ng-helpers/src/directives/click-outside/click-outside.module.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ClickOutsideModule } from './click-outside.module'; | ||
|
||
describe('ClickOutsideModule', () => { | ||
let clickOutsideModule: ClickOutsideModule; | ||
|
||
beforeEach(() => { | ||
clickOutsideModule = new ClickOutsideModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(clickOutsideModule).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
projects/ng-helpers/src/directives/click-outside/click-outside.module.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {ClickOutsideDirective} from './click-outside.directive'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
ClickOutsideDirective | ||
], | ||
exports: [ | ||
ClickOutsideDirective | ||
] | ||
}) | ||
export class ClickOutsideModule { } |
8 changes: 8 additions & 0 deletions
8
projects/ng-helpers/src/directives/form-touch-on-hover/form-touch-on-hover.directive.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { FormTouchOnHoverDirective } from './form-touch-on-hover.directive'; | ||
|
||
describe('FormTouchOnHoverDirective', () => { | ||
it('should create an instance', () => { | ||
const directive = new FormTouchOnHoverDirective(); | ||
expect(directive).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
projects/ng-helpers/src/directives/form-touch-on-hover/form-touch-on-hover.directive.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[libFormTouchOnHover]' | ||
}) | ||
export class FormTouchOnHoverDirective { | ||
|
||
constructor() { } | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
projects/ng-helpers/src/directives/form-touch-on-hover/form-touch-on-hover.module.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { FormTouchOnHoverModule } from './form-touch-on-hover.module'; | ||
|
||
describe('FormTouchOnHoverModule', () => { | ||
let formTouchOnHoverModule: FormTouchOnHoverModule; | ||
|
||
beforeEach(() => { | ||
formTouchOnHoverModule = new FormTouchOnHoverModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(formTouchOnHoverModule).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
projects/ng-helpers/src/directives/form-touch-on-hover/form-touch-on-hover.module.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {FormTouchOnHoverDirective} from './form-touch-on-hover.directive'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
FormTouchOnHoverDirective | ||
], | ||
exports: [ | ||
FormTouchOnHoverDirective | ||
] | ||
}) | ||
export class FormTouchOnHoverModule { } |
8 changes: 8 additions & 0 deletions
8
projects/ng-helpers/src/directives/stop-propagation/stop-propagation.directive.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { StopPropagationDirective } from './stop-propagation.directive'; | ||
|
||
describe('StopPropagationDirective', () => { | ||
it('should create an instance', () => { | ||
const directive = new StopPropagationDirective(); | ||
expect(directive).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
projects/ng-helpers/src/directives/stop-propagation/stop-propagation.directive.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[libStopPropagation]' | ||
}) | ||
export class StopPropagationDirective { | ||
|
||
constructor() { } | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
projects/ng-helpers/src/directives/stop-propagation/stop-propagation.module.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { StopPropagationModule } from './stop-propagation.module'; | ||
|
||
describe('StopPropagationModule', () => { | ||
let stopPropagationModule: StopPropagationModule; | ||
|
||
beforeEach(() => { | ||
stopPropagationModule = new StopPropagationModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(stopPropagationModule).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
projects/ng-helpers/src/directives/stop-propagation/stop-propagation.module.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {StopPropagationDirective} from './stop-propagation.directive'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
StopPropagationDirective | ||
], | ||
exports: [ | ||
StopPropagationDirective | ||
] | ||
}) | ||
export class StopPropagationModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {OnDestroy} from '@angular/core'; | ||
import {Subject} from 'rxjs'; | ||
|
||
/** | ||
* Uses the destroyed$ subject to indicate that the component was destroyed | ||
* | ||
* @example | ||
* class SomeComponent extends RxDestroy { | ||
* ngOnInit() { | ||
* interval(1000) | ||
* .pipe( | ||
* takeUntil(this.destroyed$) | ||
* ) | ||
* .subscribe(_ => {}); | ||
* } | ||
* } | ||
*/ | ||
export class RxDestroy implements OnDestroy { | ||
/** | ||
* Used like this in classes that extend RxDestroy: someObservable$.takeUntil(this.destroyed$) | ||
*/ | ||
destroyed$ = new Subject<void>(); | ||
|
||
/** | ||
* Calls next() on this.destroyed$ to cancel all listeners | ||
*/ | ||
ngOnDestroy() { | ||
this.destroyed$.next(); | ||
this.destroyed$.complete(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { EnumModule } from './enum.module'; | ||
|
||
describe('EnumModule', () => { | ||
let enumModule: EnumModule; | ||
|
||
beforeEach(() => { | ||
enumModule = new EnumModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(enumModule).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {EnumPipe} from './enum.pipe'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
EnumPipe | ||
], | ||
exports: [ | ||
EnumPipe | ||
] | ||
}) | ||
export class EnumModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { EnumPipe } from './enum.pipe'; | ||
|
||
describe('EnumPipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new EnumPipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'enum' | ||
}) | ||
export class EnumPipe implements PipeTransform { | ||
|
||
transform(value: any, args?: any): any { | ||
return null; | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
projects/ng-helpers/src/pipes/sanitize/sanitize.module.spec.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { SanitizeModule } from './sanitize.module'; | ||
|
||
describe('SanitizeModule', () => { | ||
let sanitizeModule: SanitizeModule; | ||
|
||
beforeEach(() => { | ||
sanitizeModule = new SanitizeModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(sanitizeModule).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {SanitizePipe} from './sanitize.pipe'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
SanitizePipe | ||
], | ||
exports: [ | ||
SanitizePipe | ||
] | ||
}) | ||
export class SanitizeModule { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { SanitizePipe } from './sanitize.pipe'; | ||
|
||
describe('SanitizePipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new SanitizePipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'sanitize' | ||
}) | ||
export class SanitizePipe implements PipeTransform { | ||
|
||
transform(value: any, args?: any): any { | ||
return null; | ||
} | ||
|
||
} |
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