Skip to content

Instantly share code, notes, and snippets.

@arturovt
Last active April 5, 2019 19:42
Show Gist options
  • Save arturovt/27e1bb798ce494a0b16b82641a2bee0d to your computer and use it in GitHub Desktop.
Save arturovt/27e1bb798ce494a0b16b82641a2bee0d to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-some-component',
template: `
<ng-template>
<p>{{ counter }}</p>
</ng-template>
`
})
export class SomeComponent {
public counter = 0;
}
// Render2
function View_AppComponent_1() {
return viewDef(
0,
[
elementDef(
0,
0,
null,
null,
1,
'p',
[],
null,
null,
null,
null,
null
),
textDef(1, null, ['', ''])
],
null,
function(_ck: NodeCheckFn, _v: ViewData) {
const _co = _v.component;
const currVal_0 = _co.counter;
_ck(_v, 1, 0, currVal_0);
}
);
}
// Ivy
function SomeComponent_ng_template_0_Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
elementStart(0, 'p');
text(1);
elementEnd();
}
if (rf & RenderFlags.Update) {
const instance = nextContext();
textBinding(1, interpolation1('', instance.counter, ''));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment