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 { ComponentSuite, ComponentSuiteElements } from '@my-test-kit'; | |
import { PortalModule, TemplatePortal } from '@angular/cdk/portal'; | |
import { | |
AfterContentInit, | |
Component, | |
TemplateRef, | |
ViewChild, | |
ViewContainerRef | |
} from '@angular/core'; | |
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
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
# This sets up Version Control System Info (vcs_info). | |
autoload -Uz vcs_info | |
# This hook function is executed before each prompt. | |
precmd() { vcs_info } | |
# This is needed to add this to our prompt: ${vcs_info_msg_0_} | |
setopt prompt_subst | |
# %F stands for foreground color and you reset it with %f. | |
# %B stands for bold and you reset it with %b. | |
# Color is set between brackets ({}) and it follows this reference>: |
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 { Component, OnDestroy } from '@angular/core'; | |
import { Subject } from 'rxjs'; | |
// WARNING: THIS DECORATOR DOES NOT WORK IN ANGULAR 9 WITH IVY. | |
/** | |
* Method decorator to automatically unsubscribe in component classes. | |
* | |
* @example | |
* ```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
import { ɵComponentDef, ɵComponentType } from '@angular/core'; | |
import { Subject } from 'rxjs'; | |
// TODO: move models to their own file. | |
// We need this interface override the readonly keyword | |
// on the properties that we want to re-assign. | |
export interface ComponentDef<T> extends ɵComponentDef<T> { | |
factory: FactoryFn<T>; | |
onDestroy: (() => void) | 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
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core'; | |
import { interval, Observable, Subject, Subscription } from 'rxjs'; | |
import { takeUntil, tap } from 'rxjs/operators'; | |
@Component({ | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
templateUrl: './boilerplate.component.html', | |
}) | |
export class BoilerplateComponent implements OnInit, OnDestroy { | |
destroyed$ = new Subject<void>(); |
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 { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core'; | |
import { interval, Observable, Subscription } from 'rxjs'; | |
import { takeUntil, tap } from 'rxjs/operators'; | |
import { ondestroy } from '../_app/decorators/ondestroy.decorator'; | |
@Component({ | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
templateUrl: './decorator.component.html', | |
}) | |
export class DecoratorComponent implements OnInit, OnDestroy { |
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 { NavRoute } from '@akelius-bsc/ng-kit'; | |
import { Location } from '@angular/common'; | |
import { Injectable } from '@angular/core'; | |
import { NavigationExtras, Router } from '@angular/router'; | |
import * as fromRootModels from '@asset-app/models'; | |
import * as routerActions from '@asset-app/store/actions/router.action'; | |
import { Actions, Effect, ofType } from '@ngrx/effects'; | |
import { map, tap } from 'rxjs/operators'; | |
@Injectable() |
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 { Constructor } from '../../models/constructor.model'; | |
import { isWindow } from '../../utils/window/window.util'; | |
/** | |
* // constructor.model.ts | |
* export type Constructor<T = unknown> = new (...args: any[]) => T; | |
* | |
* // window.util.ts | |
* export const isWindow = (element: typeof globalThis | Window | HTMLElement | null): boolean => { | |
* return element !== 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
import { Constructor } from '../../models/constructor.model'; | |
import { isWindow } from '../../utils/window/window.util'; | |
/** | |
* // constructor.model.ts | |
* export type Constructor<T = unknown> = new (...args: any[]) => T; | |
* | |
* // window.util.ts | |
* export const isWindow = (element: typeof globalThis | Window | HTMLElement | null): boolean => { | |
* return element !== 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
import { DOCUMENT } from '@angular/common'; | |
import { | |
AfterViewInit, | |
DestroyRef, | |
Directive, | |
ElementRef, | |
InputSignal, | |
OutputEmitterRef, | |
WritableSignal, | |
effect, |
OlderNewer