This file contains hidden or 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 { inject } from '@angular/core'; | |
import { HttpClient, HttpErrorResponse } from '@angular/common/http'; | |
import { Actions, createEffect, ofType } from '@ngrx/effects'; | |
import { Action, ActionCreator } from '@ngrx/store'; | |
import { catchError, map, mergeMap, of } from 'rxjs'; | |
type ActionCreatorWithData<T> = ActionCreator< | |
string, | |
(props: { data: T }) => { data: T } & Action | |
>; |
This file contains hidden or 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
const fs = require('fs'); | |
const path = require('path'); | |
const EXCLUDED_METHODS = [ | |
'constructor', | |
'writeValue', | |
'registerOnChange', | |
'registerOnTouched', | |
'setDisabledState', | |
]; |
This file contains hidden or 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 { HttpClient } from '@angular/common/http'; | |
import { inject, DestroyRef, signal, computed } from '@angular/core'; | |
import { takeUntilDestroyed, rxResource } from '@angular/core/rxjs-interop'; | |
import { | |
Subject, | |
concatMap, | |
tap, | |
Observable, | |
mergeMap, | |
switchMap, |
This file contains hidden or 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
@Component({ /* ... */ }) | |
export class SomeComponent { | |
// streamifies input | |
@Input$() prop: Observable<string>; | |
// lifecycle notifier as an Observable stream | |
@OnDestroy$() destroy$: Obseravble<void>; | |
// lifecycle hook as decorator instead of implements interface |
This file contains hidden or 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 is then built as Angualr element | |
with | |
ngDoBootstrap() { | |
const ElementExample = createCustomElement(ElementExampleComponent, { injector: this.injector }); | |
customElements.define('element-example', ElementExample); | |
} |
This file contains hidden or 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
function changeMac() { | |
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
sudo ifconfig en0 ether $mac | |
sudo ifconfig en0 down | |
sudo ifconfig en0 up | |
echo "Your new physical address is $mac" | |
} |
This file contains hidden or 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 { Injectable, Component, NgModule, defineInjectable } from '@angular/core'; | |
/** | |
* @fileoverview added by tsickle | |
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | |
*/ | |
var SomeLibService = /** @class */ (function () { | |
function SomeLibService() { | |
} | |
SomeLibService.decorators = [ |
This file contains hidden or 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 { OverlayContainer } from '@angular/cdk/overlay'; | |
export class AppComponent implements OnInit { | |
// use this to set correct theme class on app holder | |
// eg: <div [class]="themeClass">...</div> | |
themeClass: string; | |
constructor( | |
private overlayContainer: OverlayContainer |
This file contains hidden or 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 '~@angular/material/theming'; | |
// mixin name will be used in main style.scss | |
@mixin big-input-component-theme($theme) { | |
// retrieve variables from theme | |
// (all possible variables, use only what you really need) | |
$primary: map-get($theme, primary); | |
$accent: map-get($theme, accent); | |
$warn: map-get($theme, accent); |
This file contains hidden or 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 '~@angular/material/theming'; | |
@include mat-core(); | |
@import 'my-theme.scss'; | |
// import custom componenet themes | |
// unofficial naming convention to support nice ordering of files in IDE | |
// to see theme under the original style file of the componenent | |
@import 'app/shared/big-input/big-input.component.scss-theme'; |
NewerOlder