Skip to content

Instantly share code, notes, and snippets.

@arturovt
Last active April 5, 2019 19:42
Show Gist options
  • Save arturovt/1ee68a84237a44dffbfcf6cb7ff22bf3 to your computer and use it in GitHub Desktop.
Save arturovt/1ee68a84237a44dffbfcf6cb7ff22bf3 to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-some-component',
template: `
<ng-tempate>
<p>Hello world!</p>
</ng-tempate>
`
})
export class SomeComponent {}
function SomeComponent_ng_template_0_Template(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
elementStart(0, 'p'),
text(1, 'Hello world!'),
elementEnd()
}
}
class SomeComponent {
public static ngComponentDef: never = defineComponent({
type: SomeComponent,
selectors: [['app-some-component']],
factory: () => new SomeComponent(),
consts: 1,
vars: 0,
template: (rf: RenderFlags, ctx: SomeComponent) => {
if (rf & RenderFlags.Create) {
template(
0,
SomeComponent_ng_template_0_Template,
2,
0,
'ng-template'
);
}
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment