Skip to content

Instantly share code, notes, and snippets.

View alexzuza's full-sized avatar
🎯
Focusing

Alexey Zuev alexzuza

🎯
Focusing
View GitHub Profile
const { TypeCheckFile } = require('./node_modules/@angular/compiler-cli/src/ngtsc/typecheck/src/type_check_file.js');
const old = TypeCheckFile.prototype.render;
TypeCheckFile.prototype.render = function() {
const result = old.apply(this, arguments);
console.log(result.text);
return result;
};
require('./node_modules/@angular/cli/bin/ng');
const { AngularCompilerPlugin } = require('./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js');
const old = AngularCompilerPlugin.prototype._createOrUpdateProgram;
AngularCompilerPlugin.prototype._createOrUpdateProgram = async function() {
await old.apply(this, arguments);
const sourceFile = this._program.tsProgram.getSourceFiles().find(sf => sf.fileName.endsWith('app.module.ngfactory.ts'));
console.log(sourceFile.text);
};
var _decl0_1: AppComponent = (<any>(null as any));
function _View_AppComponent_1_0(): void {
var _any:any = (null as any);
const pd_1:any = ((<any>_decl0_1.test(_any)) !== false);
^^^^^^^^^^
}
@Component({
selector: 'app-root',
template: '<button (click)="test($event)">Test</button>'
})
export class AppComponent {
test() {}
}
var _decl0_1: AppComponent = (<any>(null as any));
function _View_AppComponent_1_0(): void {
const currVal_0: any = _decl0_1.foo;
}
@Component({
selector: 'app-root',
template: '{{ foo }}'
})
export class AppComponent {}
const path = require('path');
const webpack = require('webpack');
const regex = /firebase\/(app|firestore)/;
module.exports = {
mode: 'none',
entry: {
// This is our Express server for Dynamic universal
server: './server.ts'
@alexzuza
alexzuza / di_simple_app.ts
Created January 29, 2019 07:46
di simple app
@Component({
selector: 'my-app',
template: `
<div dirA>
<div dirB>Hello Ivy</div>
</div>
`
})
export class AppComponent {}
@alexzuza
alexzuza / di_false_positive.ts
Created January 29, 2019 07:45
di false positive
@Component({
selector: 'my-app',
template: `
<div>
<div dirB>Hello Ivy</div>
</div>
`
})
export class AppComponent {}
@alexzuza
alexzuza / di_r3.ts
Created January 29, 2019 07:44
di r3
export class R3Injector {
private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();
...
}