Skip to content

Instantly share code, notes, and snippets.

View alexzuza's full-sized avatar
🎯
Focusing

Alexey Zuev alexzuza

🎯
Focusing
View GitHub Profile
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);
};
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');
@NgModule({
...
declarations: [
AppComponent
]
})
export class AppModule {}
import * as i0 from '@angular/core';
import * as i1 from './app.module';
import * as i2 from '@angular/common';
import * as i3 from './foo.component';
import * as i4 from './app.component';
import * as i5 from '@angular/platform-browser';
import * as i6 from './foo.module';
export const AppModuleNgFactory:i0.NgModuleFactory<i1.AppModule> = (null as any);
var _decl0_0:i2.NgClass = (<any>(null as any));
var _decl0_1:i2.NgComponentOutlet = (<any>(null as any));
{{ unknownProp }}
var _decl0_12:i4.AppComponent = (<any>(null as any));
function _View_AppComponent_1_0():void {
var _any:any = (null as any);
const currVal_0:any = _decl0_12.unknownProp; // Property 'unknownProp' does not exist on type 'AppComponent'.
currVal_0;
}
@HostListener('click', ['$event'])
onClick() {}
function _View_AppComponent_Host_1_0():void {
var _any:any = (null as any);
const pd_0:any = ((<any>_decl0_12.onClick(_any)) !== false);
}
{{ getSomething() }}
{{ obj[prop][subProp] }}
{{ someMethod({foo: 1, bar: '2'}) }}
<div>{{"hello" | aPipe}}</div>
// Argument of type "hello" is not assignable to parameter of type number
{{ ('Test' | lowercase).startWith('test') }}
// error TS2551: Property 'startWith' does not exist on type 'string'. Did you mean 'startsWith'?