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
<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
<input type="text" value="Alexey"> | |
<button>Increment</button> |
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
@Component({ | |
..., | |
template: '<ng-template #foo></ng-template>' | |
}) | |
class SomeComponent { | |
@ViewChild('foo', {read: ElementRef}) query; | |
} |
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
var _c0 = ["color", "#efefef"]; | |
AppComponent.ngComponentDef = i0.ɵdefineComponent({ | |
type: AppComponent, | |
selectors: [["my-app"]], | |
... | |
template: function AppComponent_Template(rf, ctx) { | |
// create mode | |
if (rf & 1) { | |
i0.ɵE(0, "child", _c0); <========== used only in create mode | |
i0.ɵe(); |
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
<comp color="#efefef"></comp> |
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
function updateDirectives(_ck,_v) { | |
var currVal_0 = '#efefef'; | |
_ck(_v,1,0,currVal_0); |
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
@Component({ | |
selector: 'my-app', | |
template: ` | |
<h2>Parent</h2> | |
<child [prop1]="x"></child> | |
` | |
}) | |
export class AppComponent { | |
x = 1; | |
} |
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
function render(data) { | |
elementOpen('h1'); | |
{ | |
text('Hello, ' + data.user) | |
} | |
elementClose('h1'); | |
elementOpen('ul') | |
{ | |
elementOpen('li'); | |
{ |
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
function patch(node, fn, data) { | |
currentNode = node; | |
enterNode(); | |
fn(data); | |
exitNode(); | |
}; |