Skip to content

Instantly share code, notes, and snippets.

View trungvose's full-sized avatar
🇸🇬

Trung Vo trungvose

🇸🇬
View GitHub Profile
import { ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Input, Type, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
@Directive({
selector: '[lazyComp]'
})
export class LazyCompDirective {
private _inputs;
private _outputs;
private subscription = new Subscription();
@trungvose
trungvose / event-loop.md
Created January 4, 2021 12:16 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@trungvose
trungvose / checkboxes-single-page.ts
Last active March 11, 2021 03:54
Abstract class for handling selected items
export interface ICheckBoxModel {
checked: boolean;
}
export class CheckboxesSinglePageModel<T extends ICheckBoxModel> {
items: T[];
isSelectAll: boolean;
isIndeterminate: boolean;
constructor(items: T[], initialState = false) {
@trungvose
trungvose / nx-structure-angular-nestjs.md
Last active May 18, 2024 15:37
Nx workspace structure for NestJS and Angular

Nx

https://nx.dev/

Nx is a suite of powerful, extensible dev tools to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

It has first-class support for many frontend and backend technologies, so its documentation comes in multiple flavours.

Principles