This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class NodeInjector implements Injector { | |
constructor( | |
private _tNode: TElementNode|TContainerNode|TElementContainerNode|null, | |
private _lView: LView) {} | |
get(token: any, notFoundValue?: any): any { | |
return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use the raw bloomBit number to determine which bloom filter bucket we should check | |
// e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc | |
const b7 = bloomBit & 0x80; | |
const b6 = bloomBit & 0x40; | |
const b5 = bloomBit & 0x20; | |
const tData = tView.data as number[]; | |
if (b7) { | |
b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) : | |
(b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ivy8", | |
"version": "0.0.0", | |
"scripts": { | |
"ng": "ng", | |
"postinstall": "ivy-ngcc", | |
"start": "ng serve", | |
"build": "ng build --prod", | |
"test": "ng test", | |
"lint": "ng lint", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ivy8", | |
"version": "0.0.0", | |
"scripts": { | |
"ng": "ng", | |
"postinstall": "ivy-ngcc", | |
"start": "ng serve", | |
"build": "ng build --prod", | |
"test": "ng test", | |
"lint": "ng lint", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Inject } from '@angular/core'; | |
import { ReplaySubject, Observable } from 'rxjs'; | |
import { DOCUMENT } from '@angular/common'; | |
@Injectable() | |
export class LazyLoadingScriptService { | |
_loadedLibraries: { [url: string]: ReplaySubject<any> } = {}; | |
constructor(@Inject(DOCUMENT) private readonly document: any) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Child {{ prop1 }}</h2> | |
<sub-child [item]="3"></sub-child> | |
<sub-child *ngFor="let item of items" [item]="item"></sub-child> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function markDirty<T>(component: T) { | |
ngDevMode && assertNotNull(component, 'component'); | |
const lElementNode = _getComponentHostLElementNode(component); | |
markViewDirty(lElementNode.view); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function markViewDirty(view: LView): void { | |
let currentView: LView|null = view; | |
while (currentView.parent != null) { | |
currentView.flags |= LViewFlags.Dirty; | |
currentView = currentView.parent; | |
} | |
currentView.flags |= LViewFlags.Dirty; | |
ngDevMode && assertNotNull(currentView !.context, 'rootContext'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function scheduleTick<T>(rootContext: RootContext) { | |
if (rootContext.clean == _CLEAN_PROMISE) { | |
let res: null|((val: null) => void); | |
rootContext.clean = new Promise<null>((r) => res = r); | |
rootContext.scheduler(() => { | |
tick(rootContext.component); | |
res !(null); | |
rootContext.clean = _CLEAN_PROMISE; | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function tick<T>(component: T): void { | |
const rootView = getRootView(component); | |
const rootComponent = (rootView.context as RootContext).component; | |
const hostNode = _getComponentHostLElementNode(rootComponent); | |
ngDevMode && assertNotNull(hostNode.data, 'Component host node should be attached to an LView'); | |
renderComponentOrTemplate(hostNode, rootView, rootComponent); | |
} |