Skip to content

Instantly share code, notes, and snippets.

View arturovt's full-sized avatar
🎯

Artur arturovt

🎯
View GitHub Profile
export class AppModule {
constructor(injector: Injector) {
injector.constructor.name === 'NgModuleRef_'; // true
}
}
function evalExpression(
sourceUrl: string,
ctx: EmitterVisitorContext,
vars: { [key: string]: any },
createSourceMap: boolean
): any {
let fnBody = `${ctx.toSource()}\n//# sourceURL=${sourceUrl}`;
const fnArgNames: string[] = [];
const fnArgValues: any[] = [];
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent {}
// объект со всей информацией о компоненте перед линковкой
const compileDirectiveMetadata: CompileDirectiveMetadata = {
return Promise.resolve(this._compileModuleAndComponents(moduleType, false));
@Injectable()
class PlatformRef {
private _modules: NgModuleRef<any>[] = [];
private _destroyListeners: Function[] = [];
private _destroyed: boolean = false;
}
function createPlatform(injector: Injector): PlatformRef {
if (
_platform &&
!_platform.destroyed &&
!_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)
) {
throw new Error(
'There can be only one platform. Destroy the previous one to create a new one.'
);
}
const INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
INTERNAL_BROWSER_PLATFORM_PROVIDERS,
{
provide: COMPILER_OPTIONS,
useValue: {
providers: [
{
provide: ResourceLoader,
useClass: ResourceLoaderImpl,
deps: []
const platformBrowserDynamic = createPlatformFactory(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
class AppComponent {
public static __annotations__ = [
{
changeDetection: 0,
selector: 'app-root',
template: 'шаблон'
}
];
}
class AppComponent {
public static __prop__metadata__ = {
documentClick: {
eventName: 'document:click',
args: undefined
}
};
}