Skip to content

Instantly share code, notes, and snippets.

@robwormald
Last active Jun 16, 2019
Embed
What would you like to do?
@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