Skip to content

Instantly share code, notes, and snippets.

@alxhub
Created February 9, 2022 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alxhub/6988c63ae3e692b153ef024a7b0e292b to your computer and use it in GitHub Desktop.
Save alxhub/6988c63ae3e692b153ef024a7b0e292b to your computer and use it in GitHub Desktop.
How the Angular Compiler Works - Template Type-Checking Example TCB
import * as i0 from './test';
import * as i1 from '@angular/common';
import * as i2 from '@angular/core';
const _ctor1: <T = any, U extends i2.NgIterable<T> = any>(init: Pick<i1.NgForOf<T, U>, "ngForOf" | "ngForTrackBy" | "ngForTemplate">) => i1.NgForOf<T, U> = null!;
/*tcb1*/
function _tcb1(ctx: i0.TestCmp) { if (true) {
var _t1 /*T:DIR*/ /*165,197*/ = _ctor1({ "ngForOf": (((ctx).users /*190,195*/) /*190,195*/) /*187,195*/, "ngForTrackBy": null as any, "ngForTemplate": null as any }) /*D:ignore*/;
_t1.ngForOf /*187,189*/ = (((ctx).users /*190,195*/) /*190,195*/) /*187,195*/;
var _t2: any = null!;
if (i1.NgForOf.ngTemplateContextGuard(_t1, _t2) /*165,216*/) {
var _t3 /*182,186*/ = _t2.$implicit /*178,187*/;
"" + (((_t3 /*199,203*/).name /*204,208*/) /*199,208*/);
}
} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment