Skip to content

Instantly share code, notes, and snippets.

View draylegend's full-sized avatar

Vladimir Drayling draylegend

  • Germany
View GitHub Profile
@e-oz
e-oz / control-value-signal.ts
Created February 12, 2025 09:57
Function to get control/form value as a signal
import { computed, type Injector, isSignal, signal, type Signal, untracked } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { AbstractControl } from '@angular/forms';
import { startWith } from 'rxjs';
/**
* Returns a signal that contains the value of a control (or a form).
* @param control
* @param injector
*/
@nilsmehlhorn
nilsmehlhorn / observe.directive.spec.ts
Last active October 11, 2022 19:41
Angular Structural Directive for Handling Observables Better than NgIf & AsyncPipe
import {Component, DebugElement} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {ObserveDirective} from './observe.directive';
import {BehaviorSubject, Observable, of, throwError} from 'rxjs';
@Component({
selector: 'test-component',
template: `
<span id="next-value" *observe="value$ as value; before loading; error error;">
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>