Skip to content

Instantly share code, notes, and snippets.

View rhutchison's full-sized avatar

Ryan Hutchison rhutchison

View GitHub Profile
ng new gym.com --createApplication=false --routing=false --style=scss --directory=. --newProjectRoot=apps --skipInstall=true
ng g application gym --experimentalIvy=true --skipInstall=true --style=scss --prefix=gym
ng g application gymsearch --experimentalIvy=true --skipInstall=true --style=scss --prefix=gym
ng g application gymsolutions --experimentalIvy=true --skipInstall=true --style=scss --prefix=gym
import {
Directive,
InjectFlags,
Input,
OnInit,
ɵɵdirectiveInject as inject,
} from '@angular/core';
import { ControlContainer } from '@angular/forms';
import { FormArray, FormBuilder, FormGroup } from '@ngneat/reactive-forms';
const standaloneMocks: Type<any>[] = [];
TestBed.overrideComponent(component, {
remove: { imports: standaloneMocks },
add: { imports: MockComponents(standaloneMocks) },
});
@rhutchison
rhutchison / custom-repository.util.ts
Last active March 23, 2023 19:26
nestjs: TypeOrm 0.3.0
import { Provider, Type } from '@nestjs/common';
import { getDataSourceToken, getRepositoryToken } from '@nestjs/typeorm';
import { DataSource, DataSourceOptions, Repository } from 'typeorm';
export function provideCustomRepository<T>(
entity: Type<T>,
repository: Type<Repository<T>>,
dataSource?: DataSource | DataSourceOptions | string
): Provider {
return {
@rhutchison
rhutchison / products-search.store.ts
Last active April 13, 2024 18:24
ngxr signalStore
@Injectable()
export class ProductsSearchState extends searchStore<Product>() {
private readonly api = inject(ProductsService);
search(criteria: SearchCriteria) {
console.log(criteria);
// this.api.query(criteria);
}
}