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
export function createViewRoute( | |
originalRoute: Route, | |
parentPath: string | |
): unknown { | |
const guardString = defaultTo(''); | |
const guardArr = defaultTo([]); | |
type ViewRoute = Route & {_loadedRoutes: Routes} & {fullPath: string}; | |
const castRoute = originalRoute as ViewRoute; | |
const fullPath = | |
parentPath + |
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 {ChangeDetectorRef, TemplateRef, ViewContainerRef} from '@angular/core'; | |
import {InViewDirective} from '@ui/directives'; | |
const mockVcr = { | |
element: { | |
nativeElement: document.createElement('span'), | |
}, | |
clear: () => {}, | |
createEmbeddedView: () => {}, | |
} as unknown as ViewContainerRef; |
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
class Component { | |
public navigate({row: {id}, type}: RowAction<Item>): void { | |
if (type.includes('ctrl')) { | |
const url = this.router.serializeUrl(this.router.createUrlTree([id])); | |
window.open(url, '_blank'); // new tab | |
return; | |
} | |
this.zone.run(() => this.router.navigate([id])).then(); | |
} | |
} |
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 {coerceCssPixelValue} from '@angular/cdk/coercion'; | |
import { | |
GlobalPositionStrategy, | |
Overlay, | |
OverlayPositionBuilder, | |
OverlayRef, | |
} from '@angular/cdk/overlay'; | |
import {ComponentPortal} from '@angular/cdk/portal'; | |
import { | |
Directive, |
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 {coerceElement} from '@angular/cdk/coercion'; | |
import { | |
Directive, | |
ElementRef, | |
EventEmitter, | |
Input, | |
OnDestroy, | |
OnInit, | |
Output, | |
} from '@angular/core'; |
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
body { | |
cursor: url('./assets/svg/cross.svg'), auto; | |
} |
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
<form action="/subscribe" method="post"> | |
<fieldset> | |
<legend>Subscribe to the Newsletter</legend> | |
<input type="email" name="email"> | |
<button>Ok</button> | |
</fieldset> | |
</form> |
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
class Component { | |
create(form) { | |
if (form.valid) { | |
this.fr.post(form.value) | |
.subscribe( | |
(response) => { | |
this.router.navigate(['flight', response.id]); | |
}, | |
(e) => { |
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
export class Effects { | |
private cache = new Map(); | |
public loadCountries$ = createEffect(() => { | |
return this.actions$.pipe( | |
ofType(actions.countriesload), | |
concatMap(() => | |
this.cache.has(CACHE_KEYS.COUNTRIES) | |
? of(actions.countriessuccess(this.cache.get(CACHE_KEYS.COUNTRIES))) | |
: this.countriesService.getCollection().pipe( |
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
#generate key | |
cd ~/.ssh && ssh-keygen | |
#copy to clipboard | |
cat id_rsa.pub | pbcopy // macOS | |
cat id_rsa.pub | xclip // Linux | |
cat id_rsa.pub | clip // Win | |
Get-Content id_rsa.pub | Set-Clipboard // PowerShell | |
#add your key to your account via the website |
NewerOlder