Skip to content

Instantly share code, notes, and snippets.

@SanderElias
Last active October 21, 2022 14:14
Show Gist options
  • Save SanderElias/043e7904de7e10b9ba9a3ef948c3dde8 to your computer and use it in GitHub Desktop.
Save SanderElias/043e7904de7e10b9ba9a3ef948c3dde8 to your computer and use it in GitHub Desktop.
FantasyLand Angular
import {Component, Inputs, InputDefault, html, css} from '@angular/core'
export class MySampleComponent implements Component {
#title = "world!";
selector: 'app-my-sample-component`;
css = css`
ul {
list-style: none
}
`;
template: html`
<H1>Hello {{#title}}</H1>
<ul>
<li *ngFor="let item of inputs.items | async">{{item.name}}</li>
</ul>
<footer>{{inputs.footerTest}}></footer>
`;
inputs = Inputs({
items: {
default: InputDefault.none, // works like replaySubject, only emits after first value
observable: true,
typing: Item[]
},
footerTest: {
default: '',
typing: string
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment