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
<h1>Hello, Alexey</h1> | |
<ul> | |
<li> | |
Counter: <span>1</span> | |
</li> | |
</ul> |
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 detectChanges<T>(component: T): void { | |
const hostNode = _getComponentHostLElementNode(component); | |
ngDevMode && assertNotNull(hostNode.data, 'Component host node should be attached to an LView'); | |
const componentIndex = hostNode.tNode !.flags >> TNodeFlags.DirectiveStartingIndexShift; | |
const def = hostNode.view.tView.directives ![componentIndex] as ComponentDef<T>; | |
detectChangesInternal(hostNode.data as LView, hostNode, def, component); | |
} |
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); | |
} |
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 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 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
<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
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
{ | |
"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", |