Skip to content

Instantly share code, notes, and snippets.

View alexzuza's full-sized avatar
🎯
Focusing

Alexey Zuev alexzuza

🎯
Focusing
View GitHub Profile
function _View_AppComponent_1_0():void {
var _any:any = (null as any);
const currVal_0:any = i0.ɵinlineInterpolate(1,'',_decl0_12.flag,'');
currVal_0;
}
const _ctor1: (init: Partial<Pick<i1.ChildComponent, "prop">>) => i1.ChildComponent = (null!);
function _tcb1(ctx: i0.AppComponent) {
if (true) {
var _t1 = _ctor1({});
_t1.s; // Property 's' does not exist on type 'ChildComponent'.
var _t2 = document.createElement("app-child");
}
}
function _tcb1(ctx: i0.AppComponent) {
if (true) {
var _t1 = document.createElement("input");
_t1.s; // Property 's' does not exist on type 'HTMLInputElement'.
}
}
static ngTypeCtor<T>(init: Partial<Pick<NgForOf<T>, 'ngForOf'|'ngForTrackBy'|'ngForTemplate'>>): NgForOf<T>;
@alexzuza
alexzuza / with-loading.pipe.ts
Created August 28, 2019 16:52
With loading pipe
import { Pipe, PipeTransform } from '@angular/core';
import { isObservable, of } from 'rxjs';
import { map, startWith, catchError } from 'rxjs/operators';
@Pipe({
name: 'withLoading',
})
export class WithLoadingPipe implements PipeTransform {
transform(val) {
return isObservable(val)
@alexzuza
alexzuza / with-loading.pipe.ts
Created August 28, 2019 17:50
With loading pipe long living stream
import { Pipe, PipeTransform } from '@angular/core';
import { isObservable, of } from 'rxjs';
import { map, startWith, catchError } from 'rxjs/operators';
@Pipe({
name: 'withLoading',
})
export class WithLoadingPipe implements PipeTransform {
transform(val) {
return isObservable(val)
@alexzuza
alexzuza / products.html
Created August 28, 2019 17:52
Products html
<h2 class="title">Products</h2>
<div class="search-bar">
<input (input)="searchStream$.next($event.target.value)">
</div>
<div class="results">
<h3>Built-in solution</h3>
<div *ngIf="obs$ | async as obs">
<ng-template [ngIf]="obs.type === 'finish'">
<h3 context-help="Some description 1">Some title 1</h3>
<ng-content></ng-content>
<div class="context-help-container" #container>
<i (click)="showHelp = true;"></i>
<div *ngIf="showHelp" class="context-help-dialog">
{{ content }}
</div>
</div>
import { Component, OnInit, Input, ElementRef, HostListener, ViewChild } from '@angular/core';
@Component({
selector: '[context-help]',
templateUrl: './context-help.component.html',
styleUrls: ['./context-help.component.css'],
})
export class ContextHelpComponent {
@Input('context-help') content: string;