Last active
October 21, 2022 14:14
-
-
Save SanderElias/043e7904de7e10b9ba9a3ef948c3dde8 to your computer and use it in GitHub Desktop.
FantasyLand Angular
This file contains 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
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