Skip to content

Instantly share code, notes, and snippets.

@phenomnomnominal
Last active August 5, 2019 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phenomnomnominal/38b35f6d90b5332fc386245f5fa7593a to your computer and use it in GitHub Desktop.
Save phenomnomnominal/38b35f6d90b5332fc386245f5fa7593a to your computer and use it in GitHub Desktop.
import { Component, Directive, Pipe } from '@angular/core';
import { DatePipe as date, NgIf as ngIf } from '@angular/common';
import { SomethingComponent as something } from './something.component';
const template = function (templates: TemplateStringsArray, ...declarations: Array<Component | Directive | Pipe>) {
return function () {
// ivyMagicHere?!
};
}
@Component({
selector: 'my-component',
template: template`
<${something}
*${ngIf}="flip">
{{ created | ${date} }}
</${something}>
`
})
export class MyComponent {
public flip = Math.random () > 5;
public created = new Date();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment