Skip to content

Instantly share code, notes, and snippets.

@robwormald
Last active October 20, 2022 16:32
Show Gist options
  • Save robwormald/d1b24a19ed94a16a4f7697a7cf2277a3 to your computer and use it in GitHub Desktop.
Save robwormald/d1b24a19ed94a16a4f7697a7cf2277a3 to your computer and use it in GitHub Desktop.
@Component({
selector: 'wt-greeting',
template: (ctx: WtGreeting) => ngHtml`<h1>Hello ${uppercase(ctx.name)}</h1>`
})
class WtGreeting {
@Input() name: string;
}
@Component({
selector: 'wt-root',
template: (ctx:AppComponent) => ngHtml`
<wt-greeting name="Static Value"></wt-greeting>
<wt-greeting name=${ctx.dynamicValue}></wt-greeting>
`
})
class AppComponent {
@Input() dynamicValue = string;
}
function upperCase(value: string){
return value.toUpperCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment